MATLAB quiver3 order of direction arguments
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello,
From the docs
quiver3(x,y,z,u,v,w) plots vectors with directions determined by components (u,v,w) at points determined by (x,y,z). The matrices x,y,z,u,v, and w must all be the same size and contain the corresponding position and vector components.
When using this function in practice, I get very different plots based on the order of the u, v, w arguments. For reference, I'm trying to draw three arrows (basis vectors) that all start at the same origin, so x, y, z are all the same matrix. However, u, v, w are unit vectors representing the direction of each of the arrows I want to draw.
I assumed that MATLAB would draw x to u, y to v, and z to w independently but this doesn't seem to be the case. For x = y = z, quiver3(x, y, z, u, v, w) produces a different plot from quiver3(x, y, z, u, w, v) or some other permutation of u, v, w.
Would appreciate understanding what's going on here.
Thanks!
댓글 수: 0
답변 (1개)
Sai Bhargav Avula
2019년 7월 16일
The quiver3 function with syntax quiver3(x,y,z,u,v,w) plots a three dimensional quiver plot. It takes the first three arguments (x,y,z) as the coordinates of the origin, and the last three arguments (u,v,w) as the direction of the arrow vector.
For plotting the three arrows(basis) from the origin, you can check the following code
quiver3(zeros(3,1),zeros(3,1),zeros(3,1),[1;0;0],[0;1;0],[0;0;1]);
Please note that all the quiver3 arguments must have the same size
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Vector Fields에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!