How can i make a 3D plot that is made of many 2-points line with a direction

2 visualizzazioni (ultimi 30 giorni)
I have 2 matrices of XYZ (in one variable) that shows the location of 2 points on an object head-to-tail. I need to make a 3D plot that shows the direction of the line that connects the 2 points together (for example, the 1st matrix shows the head of the object). moreover, i need it to draw one of every 20 rows.
I don't even know where to start... my variable is with 6 (XYZXYZ) columns and about a thousand rows. Thank you very much! Ziv

Risposta accettata

Thorsten
Thorsten il 19 Nov 2014
Modificato: Thorsten il 19 Nov 2014
quiver3 is the function that you need
M = rand(100, 6);
ind = 1:20:size(M, 1);
quiver3(M(ind, 1), M(ind, 2), M(ind, 3), M(ind, 4), M(ind, 5), M(ind, 6))
  1 Commento
Ziv Kassner
Ziv Kassner il 20 Nov 2014
Thank you so much. Sadly, it doesn't work as I want it to. I need the arrows to connect both lines so, for example, every blue arrow will start the place it starts as it shows on the picture, but the head will be on the same index of XYZ on the black line.
Ziv

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su 3-D Scene Control in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by