sigma_ellipse.m

来自「This a collection of MATLAB functions fo」· M 代码 · 共 17 行

M
17
字号
function e = sigma_ellipse(x, P, n, nseg)
%function e = sigma_ellipse(x, P, n)
% INPUTS: mean [x; y], covariance [xx xy; xy yy], number of sigmas
% OUTPUT: ellipse points [x; y]
% Plot n sigma ellipse
%
% Tim Bailey 2004, modified 2006.

if nargin==4, inc = 2*pi/nseg; else inc = pi/30; end

r=sqrtm(P);
phi=[0:inc:2*pi 0];
a=n*r*[cos(phi); sin(phi)];

e(1,:)= a(1,:)+x(1);
e(2,:)= a(2,:)+x(2);

⌨️ 快捷键说明

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