How to find number of counts for atoms (each minor grid) within XY grid?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Ankit Chauhan
el 6 de En. de 2023
Comentada: Star Strider
el 10 de En. de 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 comentarios
Respuesta aceptada
Star Strider
el 6 de En. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Histograms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!