I am trying to understand the quiver
function, moreover, what exactly specifies the quiver's origin, direction, and length. I understand it is different from plotv
.
For instance, the code quiver(0,1); axis equal
produces:
which seems to start at [1,1]
, and end at [1,2]
for a length of 2. I'm not too sure how MATLAB worked that out?
Secondly, if I provide a vector if inputs such as quiver([0 0 0 0],[1 2 3 4])
, I obtain:
So each one seems to start at an integer value, but again I'm not sure how MATLAB is deducing the length or direction?
Lastly, I was trying to plot a sine wave with quivers starting at the origin and ending at the value of the sine wave on the y-axis. This is how far I got:
x = linspace(0,2*pi,100);
y = sin(x);
h = quiver(x(1:3:end),y(1:3:end));
Why do the quivers angle forward? And how can I normalize the arrow heads so they are the same size? I tried accessing the property MaxHeadSize
, but it only works for the largest one.
Could someone please describe what is going on?