0001 function out=get(g,field)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 switch field
0020 case 'dim'
0021 out=g.dim;
0022 case 'mean'
0023 out=g.m;
0024 case 'covariance'
0025 out=g.S;
0026 case 'information'
0027 out=g.iS;
0028 case 'volume'
0029 out=g.d;
0030 case 'normalizationFactor'
0031 out=g.ct;
0032 case 'ellipse'
0033 S2d=g.S(1:2,1:2);
0034
0035
0036 R=chol(S2d);
0037 y = 2.1459*[cos(0:0.1:2*pi);sin(0:0.1:2*pi)];
0038 el=R*y;
0039 out = [el el(:,1)]+repmat(g.m(1:2),1,size(el,2)+1);
0040
0041 otherwise
0042 error('Unknow field in Gaussian get');
0043 end