Write matlab code for the following algorithm
Afficher commentaires plus anciens
I have this algorithm

I write this code for my example
A = [10 -10; 1 0; -1 0; 0 -1 ; 0 1; 11 -10; -1 -1];
C = cov(A).^(-1/2).*A;
M = size(A,1);
omega = C*C';
x0=[];x1=[];x2=[];PS=[];
for i0=1:M
for i1=1:M
for i2=1:M
j = 0;
if isequal(i2,i1)
x2(j) = abs(omega(i1,i0)+omega(i2,i0));
j = j+1;
end
end
x1(j) = min(median(x2,'all')); % lower median
end
x0(j) = 1.1 .* min(median(x1,'all')); % lower median
end
for i3=1:M
PS(i3) = max(omega(i3)/x0);
end
but the above-mentioned code has many problems. I do not know how to fix it.
the result should be
PS = [16.77;0.839;0.839;0.839;0.839;17.609;1.677];
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices 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!