covarianceEllipse now returns the matlab handle for the lines object to allow for additional formatting by the user
parent
c1a018a1fd
commit
6a91d7405c
|
@ -1,4 +1,4 @@
|
||||||
function covarianceEllipse(x,P,color, k)
|
function h = covarianceEllipse(x,P,color, k)
|
||||||
% covarianceEllipse plots a Gaussian as an uncertainty ellipse
|
% covarianceEllipse plots a Gaussian as an uncertainty ellipse
|
||||||
% Based on Maybeck Vol 1, page 366
|
% Based on Maybeck Vol 1, page 366
|
||||||
% k=2.296 corresponds to 1 std, 68.26% of all probability
|
% k=2.296 corresponds to 1 std, 68.26% of all probability
|
||||||
|
@ -13,7 +13,7 @@ s1 = s(1,1);
|
||||||
s2 = s(2,2);
|
s2 = s(2,2);
|
||||||
if nargin<4, k = 2.296; end;
|
if nargin<4, k = 2.296; end;
|
||||||
[ex,ey] = ellipse( sqrt(s1*k)*e(:,1), sqrt(s2*k)*e(:,2), x(1:2) );
|
[ex,ey] = ellipse( sqrt(s1*k)*e(:,1), sqrt(s2*k)*e(:,2), x(1:2) );
|
||||||
line(ex,ey,'color',color);
|
h = line(ex,ey,'color',color);
|
||||||
|
|
||||||
function [x,y] = ellipse(a,b,c);
|
function [x,y] = ellipse(a,b,c);
|
||||||
% ellipse: return the x and y coordinates for an ellipse
|
% ellipse: return the x and y coordinates for an ellipse
|
||||||
|
|
Loading…
Reference in New Issue