taking the inverse of multiple matrix's
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Andrew MacPhee
le 9 Fév 2023
Réponse apportée : Harshvardhan
le 11 Mar 2023

sigma is a 28x28x10 matrix, or 10 28x28 matrix's. I'd like to get the iverse of each of those matrix's and store them in mean_inverse, but it is saying "Warning: Matrix is singular to working precision. " What am I doing wrong?
1 commentaire
Réponse acceptée
Torsten
le 9 Fév 2023
Déplacé(e) : Torsten
le 9 Fév 2023
What am I doing wrong?
Nothing. But some or all of the sigma matrices that you try to invert seem to be singular.
1 commentaire
Walter Roberson
le 9 Fév 2023
There are, however, arguments to be made that in practice using inv() is most often a mistake, that there are very often mathematically better methods that do not involve explicit calculation of the inverse of a matrix.
Plus de réponses (1)
Harshvardhan
le 11 Mar 2023
% Define the matrices
A = [1 2; 3 4];
B = [5 6; 7 8];
C = [9 10; 11 12];
% Create a cell array of the matrices
matrices = {A, B, C};
% Loop through the matrices and calculate their inverses
for i = 1:length(matrices)
inv_matrices{i} = inv(matrices{i});
end
% Display the inverse matrices
for i = 1:length(inv_matrices)
disp(['Inverse of matrix ', num2str(i), ':']);
disp(inv_matrices{i});
end
0 commentaires
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!