MATLAB: How to plot 3d using coordinates

plot2

Hi fellows, Could you tell me how to plot 3d using coodinates? For example, I have the coordinates for one point is 0.2,0.3,04 and for another point is -0.3,0.3,0.1. How can I plot them in one graph and also connect the two points?

Best Answer

v1=[0.2,0.3 4 ],
v2=[-0.3,0.3,0.1],
v=[v2;v1];
plot3(v(:,1),v(:,2),v(:,3),'r')