You can use this code:
xyz = [-8.67212090030965 -7.78294481282592 4.19809966191787
4.30363429770975 -6.33796132936349 2.30412196271579
11.4626419696253 3.31049523749869 2.84193335035400
1.28757516363600 6.20802478748340 11.1358580308193]
x1 = xyz(:, 1);
y1 = xyz(:, 2);
z1 = xyz(:, 3);
SizeXYZ = size(xyz,1);
for i = 1:SizeXYZ
[x,y,z] = createspheres(x1(i),y1(i),z1(i));
surf(x,y,z);
hold on
end
function [X,Y,Z] =createspheres(spherex, spherey, spherez)
[x, y, z] = sphere(20);
X= x+ spherex;
Y = y+ spherey;
Z = z+spherez;
end
Best Answer