How to find number of counts for atoms (each minor grid) within XY grid?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ankit Chauhan
am 6 Jan. 2023
Kommentiert: Star Strider
am 10 Jan. 2023
Hello everyone, I have ID, type and XYZ coordinates of atoms within a box (as attached 1_aniline_epoxy_inftrated_ID_type_XYZ_data.txt data and image). Box is transformed in to number of XY grids or rectangle. I want to count number of atoms belong to each rectangle and want to plot number of counts into XY plot. Data and figure is attached.
Thank you,
Ankit
0 Kommentare
Akzeptierte Antwort
Star Strider
am 6 Jan. 2023
I am not certain what you want.
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1254562/1_aniline_epoxy_inftrated_ID_type_XYZ_data.txt');
T1.Properties.VariableNames = {'ID','Type','X','Y','Z'}
figure
scatter3(T1.X, T1.Y, T1.Z, 15, T1.Type, 'filled')
xlabel('X')
ylabel('Y')
zlabel('Z')
title('3D Scatterplot Of Data')
axis('equal')
colormap(turbo(numel(unique(T1.Type))))
title('3D Scatterplot Of Data')
figure
hh3 = histogram2(T1.X, T1.Y, 10);
hh3.FaceColor = 'flat';
colormap(turbo)
xlabel('X')
ylabel('Y')
zlabel('Z')
title('2D Histogram Of Data')
gethh3 = get(hh3); % Handle To Function
% Vals = hh3.Values % Same Matrix As 'Counts' Here
Counts = hh3.BinCounts
.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!