MATLAB quiver3 order of direction arguments
    5 views (last 30 days)
  
       Show older comments
    
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 Comments
Answers (1)
  Sai Bhargav Avula
    
 on 16 Jul 2019
        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 Comments
See Also
Categories
				Find more on Vector Fields in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!