MATLAB: Plotting in a 3D space

3d plots

I have a vector r=[1;0;-1]; and I would like to plot this in the 3D space. Can anyone please help me with this?

Best Answer

This will plot a line segment from the origin to the point (1,0,-1):
plot3([0 r(1)],[0 r(2)],[0 r(3)]);