Plotting in a 3D space

8 次查看(过去 30 天)
Gopika R
Gopika R 2020-7-2
评论: Gopika R 2020-7-2
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?

采纳的回答

Voss
Voss 2020-7-2
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 个)

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

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by