Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
13x13 matrix

Respuestas (3)

madhan ravi
madhan ravi el 26 de Nov. de 2023
doc det
doc transpose
  2 comentarios
Efe
Efe el 26 de Nov. de 2023
I'm sorry, I asked the question incompletely. How can I write the matrix in a short way?
Walter Roberson
Walter Roberson el 26 de Nov. de 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

Iniciar sesión para comentar.


Torsten
Torsten el 26 de Nov. de 2023
Movida: Torsten el 26 de Nov. de 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 el 26 de Nov. de 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.

Categorías

Más información sobre Operating on Diagonal Matrices en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by