Unit vectors. How can I plot them?

조회 수: 49 (최근 30일)
Ocram
Ocram 2012년 4월 28일
Dear all, I need to plot vectors given as a matrix of several row and three column. For each row I would like to plot an indipendent vector using three scalar (the cosin director).
Do you have any idea? Regards, MG
************************************************************************************************************************************
I wrote this: quiver3(zeros(3,1),zeros(3,1),zeros(3,1),[1;0;0],[0;1;0],[0;0;1]) in order to create a reference system XYZ. This is ok!!
Now I want to plot a line (a unit vector) over the refernce system...for example V=[0.22 0.51 -0.82]. I don't have any origin or any end pont... just the direction cosine. I got this vector V in this way: Using two 3D point (for example A and B) I get the vector v=A-B then the unit vector V= (A-B)/norm(A-B) So If I want to plot V, without A and B, but only using V... how can I do?
Thanks
[EDITED, Jan S, copied from answer section]:
3D plot. Just a simple line without arrows. I tried with quiver3 but in this function I can only insert point to point coordinates. But I just have the direction....
  댓글 수: 2
Jan
Jan 2012년 4월 28일
Do you want a 2D or 3D plot? Do you want thin lines or thicker 3D lines, arrow heads or lines only? Please post more details.
BTW, please vote and accept answers, which helped you.
Jan
Jan 2012년 4월 29일
Please add further explanations by adding to the original question, not by creating an answer.

댓글을 달려면 로그인하십시오.

답변 (2개)

Jan
Jan 2012년 4월 29일
quiver3(zeros(3,1),zeros(3,1),zeros(3,1),[1;0;0],[0;1;0],[0;0;1]);
hold('on');
quiver3(0,0,0,V(1),V(2),V(3), 'r');

Jan
Jan 2012년 4월 29일
The direction of a unit vector is the end position of the vector, when you start from the origin. Please post, what you have tried with quiver3 and explain, which problems occurred.

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by