how can i draw a coordinate system of unit vectors?
조회 수: 72 (최근 30일)
이전 댓글 표시
How can you draw a coordinatesystem of unitvectors like in the picture attached (don't mind the vector P)?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/157230/image.jpeg)
댓글 수: 0
답변 (2개)
Star Strider
2016년 3월 9일
This works:
You may have to rotate it using the view function and do some other modifications to get it to look the way you want it. This just plots the vectors:
figure(1)
plot3( [0 0 0; 0 0 0; 0 0 1], [0 0 0; 0 1 0; 0 0 0], [1 0 0; 0 0 0; 0 0 0], 'p-r')
grid on
axis([-1 2 -1 2 -1 2])
% axis equal
댓글 수: 0
George Abrahams
2023년 12월 14일
편집: George Abrahams
2023년 12월 14일
Hi Christian. For future reference, my plotframe function on File Exchange makes this easy. It's as simple as:
plotframe( rotationMatrix, translationVector )
axis equal, view( [37.5 30] )
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1569248/image.png)
Or if you want it formatted more similarly to the one in your figure, you can do that as follows:
plotframe( BasisColors='k', LabelBasis=true, ...
Labels=["$\hat{X}_{A}$","$\hat{Y}_{A}$","$\hat{Z}_{A}$"], ...
TextProperties={'Interpreter','Latex'} )
axis equal, view( [37.5 30] )
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1569253/image.png)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Map Display에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!