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

2 ビュー (過去 30 日間)
Ziv Kassner
Ziv Kassner 2014 年 11 月 19 日
コメント済み: Ziv Kassner 2014 年 11 月 20 日
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

採用された回答

Thorsten
Thorsten 2014 年 11 月 19 日
編集済み: Thorsten 2014 年 11 月 19 日
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 件のコメント
Ziv Kassner
Ziv Kassner 2014 年 11 月 20 日
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

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange3-D Scene Control についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by