how to plot 3d using coordinates
72 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
xueqi
el 14 de Mzo. de 2013
Respondida: Noman Alam
el 17 de Feb. de 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?
0 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 14 de Mzo. de 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')
0 comentarios
Más respuestas (2)
Shaun VanWeelden
el 14 de Mzo. de 2013
line([x1 x2],[y1 y2],[z1 z2]) and you can put as many points as you want in each vector obviously
4 comentarios
Deming Zheng
el 10 de Sept. de 2015
the line command works, you can simply use "view(az, el)" to see the 3d plot. where (AZ,EL) = view returns the current azimuth and elevation. e.g. try view(30,10) after the line command. clc clear x = line([0 1],[0,0],[0,0],'color','r'); y = line([0 0],[0,1],[0,0],'color','g'); z = line([0 0],[0,0],[0,1],'color','b'); view (30,30) grid on
Thi Minh Anh Quang
el 30 de Oct. de 2020
Editada: Thi Minh Anh Quang
el 30 de Oct. de 2020
or use
rotate3d on
to drag the axes freely
Noman Alam
el 17 de Feb. de 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')
0 comentarios
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!