compass
Draws vectors as arrows that start at the origin of a polar-style plot.
Category: Graphics > 2-D and 3-D Plots
Syntax
compass(U, V)
Draws an arrow from the origin to each point (U, V).
compass(Z)
Uses the real and imaginary parts of the complex array Z as U and V.
h = compass(___)
Also returns the graphics handles.
Description
Each arrow has the direction and length of its vector, drawn over circles that give the magnitude. It suits wind directions, phasors and the roots of a polynomial in the complex plane.
Input arguments
U, V- Arrays of the same size with the horizontal and vertical components.
Z- Complex array; each element is a vector
real(Z) + i*imag(Z).
Output arguments
h- Handles of the arrow lines.
Example
Phasors
z = [1+1i, -2+0.5i, 0.5-2i];
compass(z)
In the app, the figure is drawn below the code.