《Matlab compass罗盘函数的用法.docx》由会员分享,可在线阅读,更多相关《Matlab compass罗盘函数的用法.docx(2页珍藏版)》请在三一办公上搜索。
1、Matlab compass罗盘函数的用法Matlab compass函数用法 MATLAB Function Reference compass Plot arrows emanating from the origin画从原点发出的箭头 Syntax语法 compass(X,Y) compass(Z) compass(.,LineSpec) h = compass(.) 其中X,Y,Z都是在笛卡尔直角坐标系中的坐标点,箭头是画在一个圆形的网格里。 用法一: compass(X,Y) displays a compass plot having n arrows, where n is th
2、e number of elements in X or Y. The location of the base of each arrow is the origin. The location of the tip of each arrow is a point relative to the base and determined by X(i),Y(i). X,Y都有一维数组,数组长度都为n, 则compass(X,Y) 会画出一组从原点出发,指向的箭头,且箭头终点在. 当然x,y分别为一个数时,只画一个箭头。 Eg: compass(2,2) X=1 1 -1 -1; Y=0 1
3、1 -1; compass(X,Y) 用法二: compass(Z) displays a compass plot having n arrows, where n is the number of elements in Z. The location of the base of each arrow is the origin. The location of the tip of each arrow is relative to the base as determined by the real and imaginary components of Z. This syntax
4、 is equivalent to compass(real(Z),imag(Z). 当Z是复数时,坐标终点横坐标为其实部,纵坐标为其虚部 Eg: a=1+2*j a = 1.0 + 2.0000i compass(a) 用法三: compass(.,LineSpec) draws a compass plot using the line type, marker symbol, and color specified by LineSpec. 可以用Line的特性参数LineSpec.来设置compass的性质。 可以设置的参数有线得类型,符号,颜色 Eg: compass(a,r) compass(a,+) compass(1,2,-)