compass(Z)
compass(U, V)
compass(..., LineSpec)
compass(..., propertyName, propertyValue)
compass(parent, ...)
h = compass(...)
compass draws arrows starting from the origin toward the cartesian points defined by the input components on a polar grid.
With a single complex input Z, the real parts are the horizontal components and the imaginary parts are the vertical components; this is equivalent to compass(real(Z), imag(Z)).
With two real inputs U and V, each pair (U, V) is a cartesian point and the arrow points from the origin to that point. When U and V are matrices, one arrow is drawn for each element.
Each vector is drawn as a Line object made of a shaft from the origin and a short two-segment arrowhead, over a polar reference grid. h = compass(...) returns a column vector of Line objects, one per vector.
Z = [1 + 2i, 2 - 1i, -1 + 1i];
compass(Z);
U = [1 3 2];
V = [2 1 -1];
h = compass(U, V, '-r');
set(h, 'LineWidth', 1.5);