get_ellipsoid_gate.m
来自「一个目标跟踪系统的MATLAB 源程序包」· M 代码 · 共 27 行
M
27 行
% function [X, Y] = get_ellipsoid_gate(center, covariance, g)
%
% get the ellipsoid gate around the center
% useful for two dimensional plot of the estimated/predicted position
%
% center --- two dimensional position
% covariance --- two dimensional covariance matrix
% g --- size of the gate, default g=2
% X --- position of ellipsoid gate along X-axis
% Y --- position of ellipsoid gate along Y-axis
% by Huimin Chen, 09/10/01
function [X, Y] = get_ellipsoid_gate(center, covariance, g)
if nargin < 3
g=2;
end
[V, D] = eig(covariance);
d = diag(D);
theta = linspace(0.01,2*pi,100);
d1 = [d(1).*cos(theta); d(2).*sin(theta)];
d2 = V * d1;
X = d2(1,:)+center(1);
Y = d2(2,:)+center(2);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?