sir I found sum of eigen values of a square matrix. Now I want to find the number of components which cover up to 0.95(95%). My part of prgramme is given in body
Afficher commentaires plus anciens
sumlamda=0;
for i=1:p
sumlamda = sumlamda+lamda(i);
end
sum=sumlamda
ccomp=0;
s =lamda(p)/sum;
for i =(p-1):1
if s <=0.95
ccomp = ccomp+1;
end
s=(lamda(i)+lamda(i+1))/sum ;
end
ccomp
Réponses (1)
Thorsten
le 18 Jan 2016
E = sort(lambda, 'descend');
N = nnz(cumsum(E/sum(E)) <= 0.95)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!