指南针图显示了方向或速度矢量, 箭头从原点开始出现。 X, Y和Z在笛卡尔坐标中, 并绘制在圆形网格上。
句法
compass(X, Y) // It shows the compass plot having n arrows, where n is the number of components in X or Y. The area of the base of each arrow is the origin. compass(Z) // It displays a compass plot having n arrows, where n is the number of elements in Z.compass(..., LineSpec) // It draws a compass plot using the line type, marker symbol, and color specified by LineSpec.h = compass(...)// It returns handles to line objects.
例子
z=cosθ+isinθ, -π≤θ≤πth=-pi:pi/5:pi;
zx=cos(th);
zy=sin(th);
z=zx+i*zy;
compass(z)
【MATLAB函数compass()】输出
文章图片
推荐阅读
- MATLAB函数quiver()
- MATLAB函数contour()
- MATLAB函数Comet()
- MATLAB函数stem()
- MATLAB函数Pie()
- MATLAB函数area()
- MATLAB函数hist()
- MATLAB函数barh()
- MATLAB函数errorbar()