How to find number of counts for atoms (each minor grid) within XY grid?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Ankit Chauhan
il 6 Gen 2023
Commentato: Star Strider
il 10 Gen 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 Commenti
Risposta accettata
Star Strider
il 6 Gen 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Histograms in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!