Effacer les filtres
Effacer les filtres

How can I find the determinant and transpose of a 13*13 matrix without writing all the numbers one by one?

2 vues (au cours des 30 derniers jours)
13x13 matrix

Réponses (3)

madhan ravi
madhan ravi le 26 Nov 2023
doc det
doc transpose
  2 commentaires
Efe
Efe le 26 Nov 2023
I'm sorry, I asked the question incompletely. How can I write the matrix in a short way?
Walter Roberson
Walter Roberson le 26 Nov 2023
You could construct the matrix using sparse by listing the row numbers and column numbers and corresponding values. I count about 42 non-zero elements, so it would look like
sparse(list_of_42_rows, list_of_42_columns, list_of_42_values)
That would be 42*3 = 126 elements to enter instead of 13*13 = 169 -- but it would also be much easier to get wrong. TANSTAAFL

Connectez-vous pour commenter.


Torsten
Torsten le 26 Nov 2023
Déplacé(e) : Torsten le 26 Nov 2023
If a matrix is structured as irregularily as the one you posted, there is no other way as to reference its nonzero elements one by one:
A = zeros(13);
A(1,1) = 29/20;
A(1,2) = -1;
A(1,5) = -1/5;
...

John D'Errico
John D'Errico le 26 Nov 2023
You have many almost random looking numbers. So without knowing how they were generate, it is impossible to do better than stuffing the elements of your matrix using either the scheme @Torsten or @Walter Roberson has proposed.
HOWEVER, IF there is some formula that generates those numbers, then you need to write it in MATLAB code. And only you can write that code, since only you know how those coefficients were generated, and what the placement means. But surely there is SOME formula. We cannot guess it however.

Catégories

En savoir plus sur Operating on Diagonal Matrices dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by