plterrel.m

来自「GPS相关工具」· M 代码 · 共 34 行

M
34
字号
function plterrel(xo,yo,C,s,ltype)% PLTERREL  Plots an error ellipse on screen.%   Note 1: x & y represent north & south (opposite of%   normal MatLab convention).  Note 2: use a square%   aspect ratio for plot; i.e., use axis('square')%   command.  Non-vectorized.% Version: 18 Jan 96% Useage:  plterrel(xo,yo,C,s,ltype)% Input:   xo - x (north) origin of ellipse%          yo - y (east) origin of ellipse%          C  - covariance matrix (2x2)%          s  - ellipse scale factor (default=1)%          ltype - line type for error ellipse%                  (default=solid,red)% Output:  Plotted error ellipse centred at (xo,yo)if nargin<3  error('Too few input arguements');endif nargin<4  s=1;             % Define default scale factorendif nargin<5  ltype='-r';      % Define default color redenddt=0.1;            % Angular resolutiont=[(0:dt:2*pi)';0];[V,D]=eig(C);      % Eigenvalues & vectorsr=sqrt(diag(D));   % Length of axesx=s*r(1)*cos(t);y=s*r(2)*sin(t);xx=xo+[x y]*V(1,:)';yy=yo+[x y]*V(2,:)';plot(yy,xx,ltype);  % Switch x (north) & y (east)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?