how to plot 3d using coordinates

217 views (last 30 days)
xueqi
xueqi on 14 Mar 2013
Answered: Noman Alam on 17 Feb 2021
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?

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 14 Mar 2013
v1=[0.2,0.3 4 ],
v2=[-0.3,0.3,0.1],
v=[v2;v1];
plot3(v(:,1),v(:,2),v(:,3),'r')

More Answers (2)

Shaun VanWeelden
Shaun VanWeelden on 14 Mar 2013
line([x1 x2],[y1 y2],[z1 z2]) and you can put as many points as you want in each vector obviously
  4 Comments
Thi Minh Anh Quang
Thi Minh Anh Quang on 30 Oct 2020
Edited: Thi Minh Anh Quang on 30 Oct 2020
or use
rotate3d on
to drag the axes freely

Sign in to comment.


Noman Alam
Noman Alam on 17 Feb 2021
v1=[0.2,0.3 4 ],
v2=[-0.3,0.3,0.1],
v=[v2;v1];
plot3(v(:,1),v(:,2),v(:,3),'r')

Tags

Community Treasure Hunt

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

Start Hunting!