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

2 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

Thorsten
Thorsten am 19 Nov. 2014
Bearbeitet: Thorsten am 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 Kommentar
Ziv Kassner
Ziv Kassner am 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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 3-D Scene Control finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by