
function [v,d] = eig2(vert,crit)

[v,d] = eig(cov(vert));

for i=1:size(v,2)
    v_i = v(abs(v(:,i))>crit,i);
    if (sum(v_i)<0)
        v(:,i) = -v(:,i);
    end
end
