Effacer les filtres
Effacer les filtres

The results display problem

2 vues (au cours des 30 derniers jours)
Jiapeng
Jiapeng le 21 Nov 2022
My code ishere. How about displaying every x and r from 1 to 4?
A= [1.02 0.95 0.77 0.67 0.56 0.30 0.16 0.01];
b = [0.39 0.32 0.22 0.18 0.15 0.12 0.13 0.15];
for i = 1:4
num = 10.^(-i);
A = A+num;
b = b+num;
[U,S,V] = svd(A,0);
x = V.*(S.^(-1)).*U';
r = rank(A);
end
disp(x);
disp(r);

Réponse acceptée

David Hill
David Hill le 21 Nov 2022
A= [1.02 0.95 0.77 0.67 0.56 0.30 0.16 0.01];
b = [0.39 0.32 0.22 0.18 0.15 0.12 0.13 0.15];
for i = 1:4
num = 10.^(-i);
A = A+num;
b = b+num;
[U,S,V] = svd(A,0);
x(:,:,i) = V.*(S.^(-1)).*U';
r(i)= rank(A);
end
disp(x);
(:,:,1) = 0.2556 -Inf -Inf -Inf -Inf -Inf -Inf -Inf 0.2396 Inf -Inf -Inf -Inf -Inf -Inf -Inf 0.1985 -Inf Inf -Inf -Inf -Inf -Inf -Inf 0.1757 -Inf -Inf Inf -Inf -Inf -Inf -Inf 0.1506 -Inf -Inf -Inf Inf -Inf -Inf -Inf 0.0913 -Inf -Inf -Inf -Inf Inf -Inf -Inf 0.0593 -Inf -Inf -Inf -Inf -Inf Inf -Inf 0.0251 -Inf -Inf -Inf -Inf -Inf -Inf Inf (:,:,2) = 0.2518 -Inf -Inf -Inf -Inf -Inf -Inf -Inf 0.2362 Inf -Inf -Inf -Inf -Inf -Inf -Inf 0.1961 -Inf Inf -Inf -Inf -Inf -Inf -Inf 0.1738 -Inf -Inf Inf -Inf -Inf -Inf -Inf 0.1493 -Inf -Inf -Inf Inf -Inf -Inf -Inf 0.0914 -Inf -Inf -Inf -Inf Inf -Inf -Inf 0.0602 -Inf -Inf -Inf -Inf -Inf Inf -Inf 0.0267 -Inf -Inf -Inf -Inf -Inf -Inf Inf (:,:,3) = 0.2514 -Inf -Inf -Inf -Inf -Inf -Inf -Inf 0.2359 Inf -Inf -Inf -Inf -Inf -Inf -Inf 0.1959 -Inf Inf -Inf -Inf -Inf -Inf -Inf 0.1736 -Inf -Inf Inf -Inf -Inf -Inf -Inf 0.1492 -Inf -Inf -Inf Inf -Inf -Inf -Inf 0.0914 -Inf -Inf -Inf -Inf Inf -Inf -Inf 0.0602 -Inf -Inf -Inf -Inf -Inf Inf -Inf 0.0269 -Inf -Inf -Inf -Inf -Inf -Inf Inf (:,:,4) = 0.2514 -Inf -Inf -Inf -Inf -Inf -Inf -Inf 0.2358 Inf -Inf -Inf -Inf -Inf -Inf -Inf 0.1958 -Inf Inf -Inf -Inf -Inf -Inf -Inf 0.1736 -Inf -Inf Inf -Inf -Inf -Inf -Inf 0.1492 -Inf -Inf -Inf Inf -Inf -Inf -Inf 0.0914 -Inf -Inf -Inf -Inf Inf -Inf -Inf 0.0603 -Inf -Inf -Inf -Inf -Inf Inf -Inf 0.0269 -Inf -Inf -Inf -Inf -Inf -Inf Inf
disp(r);
1 1 1 1

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by