aw ellipsoid v'*W*v &lt;= mu</span>
mu = diag(V'*W*V);
mu = mean(mu(ind));
angles = linspace(0,2*pi,noangles);
R = chol(W);  <span class="comment">% W = R'*R</span>
ellipsoid = sqrt(mu)*(R\[cos(angles); sin(angles)]);
d = plot(ellipsoid(1,:), ellipsoid(2,:), <span class="string">'--'</span>, 0, 0, <span class="string">'+'</span>);
set(d, <span class="string">'Color'</span>, [0 0.5 0]);
set(d(2), <span class="string">'MarkerFaceColor'</span>, [0 0.5 0]);
hold <span class="string">on</span>

dot = plot(V(1,:)