MATLAB quiver3 order of direction arguments

6 ビュー (過去 30 日間)
carpetfizz
carpetfizz 2019 年 7 月 1 日
回答済み: Sai Bhargav Avula 2019 年 7 月 16 日
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!

回答 (1 件)

Sai Bhargav Avula
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

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by