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

2 次查看(过去 30 天)
13x13 matrix

回答(3 个)

madhan ravi
madhan ravi 2023-11-26
doc det
doc transpose
  2 个评论
Walter Roberson
Walter Roberson 2023-11-26
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

请先登录,再进行评论。


Torsten
Torsten 2023-11-26
移动:Torsten 2023-11-26
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 2023-11-26
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.

类别

Help CenterFile Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by