Plotting Lines and Points in 3D

4 vues (au cours des 30 derniers jours)
DJ V
DJ V le 21 Mai 2024
Commenté : Voss le 21 Mai 2024
I need to learn how to plot lines and points in 3D. Can someone please provide an example in Matlab? Thank you.

Réponse acceptée

Voss
Voss le 21 Mai 2024
A = [1 -3 7];
B = [0 2 -6];
C = [0.5 -1 5];
% plot a line from A to B
v = [A; B];
plot3(v(:,1),v(:,2),v(:,3))
box on
grid on
xlabel('x')
ylabel('y')
zlabel('z')
% plot the point C
hold on
plot3(C(1),C(2),C(3),'o')
  8 commentaires
DJ V
DJ V le 21 Mai 2024
The man with all the answers!
Voss
Voss le 21 Mai 2024

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Objects dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by