Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

I had asked for an explanation for 2 codes before this. This algorithm compares the previous two. Can I get a step by step explanation as to how this works? I'd really appreciate any help.

2 vues (au cours des 30 derniers jours)
Sneha Ramesh
Sneha Ramesh le 2 Juil 2013
Clôturé : MATLAB Answer Bot le 20 Août 2021
Comparison of Efficiency in Terms of Reduction:
function [G]= compare(A)
G=cell(1,9);
[U S V]=svd(A); %calling built-in SVD
G{1,1}=S;
Ts=trace(S); %sum of diag elements of S
[Vj,D]=JacobiEig(A); %calling Jacobi SVD method from the same directory
G{1,2}=D;
Tj=trace(D); %sum of diag elements of D
[Z PCred Vp Di] = pca1(A); %calling PCA method from the same directory
G{1,3}=Di;
Tp=trace(Di); %sum of diag elements of Di
if Ts < Tj
disp('SVD is lighter in magnitude than Jacobi SVD');
if Ts < Tp
disp('SVD is lighter in magnitude than PCA');
else
disp('PCA is lighter in magnitude than SVD');
end
else
disp('Jacobi SVD is lighter in magnitude than SVD');
if Tj < Tp
disp('Jacobi SVD is lighter in magnitude than PCA');
else
disp('PCA is lighter in magnitude than Jacobi SVD');
end
end
[K,m,L,n] = Compress(S,D);
[Mj,Ms] = Recon(K,m,L,n,Vj,S,V,U);
G{1,4}=K;
G{1,5}=Mj;
G{1,6}=PCred;
G{1,7}=Z;
G{1,8}=L;
G{1,9}=Ms;
end

Réponses (0)

Cette question est clôturée.

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by