필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
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 CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by