MATLAB Answers

Plotting in a 3D space

7 views (last 30 days)
Gopika R
Gopika R on 2 Jul 2020
Commented: Gopika R on 2 Jul 2020
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?

  0 Comments

Sign in to comment.

Accepted Answer

Benjamin
Benjamin on 2 Jul 2020
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)]);

  1 Comment

Gopika R
Gopika R on 2 Jul 2020
Thank you

Sign in to comment.

More Answers (1)

madhan ravi
madhan ravi on 2 Jul 2020
r = num2cell(r);
plot3(r{:}, '*')

  1 Comment

Gopika R
Gopika R on 2 Jul 2020
Thank you..

Sign in to comment.

Tags


Translated by