Borrar filtros
Borrar filtros

I want to get vector of det

4 visualizaciones (últimos 30 días)
Jonghun
Jonghun el 28 de Jul. de 2013
-my code-
a=[1 0 0 0]; b=[0 1 0 0]; c=[0 0 1 0]; d=[0 0 0 1];
detvector=det([a b c d]);
-I want to get detvector=[det([a(1) b(1) c(1) d(1)]),det([a(2) b(2) c(2) d(2)]),det([a(3) b(3) c(3) d(3)]),det([a(4) b(4) c(4) d(4)])]. But my code doesn't works. How can I solve it?
  1 comentario
Jan
Jan el 28 de Jul. de 2013
Editada: Jan el 28 de Jul. de 2013
Please follow the "? Help" link to learn how to format code in the forum. Thanks.
Instead of posting "my code does not work", an explicit description would be more useful: Post the code and a copy of the error message, or explain the difference between your expectations and the results.

Iniciar sesión para comentar.

Respuesta aceptada

Roger Stafford
Roger Stafford el 28 de Jul. de 2013
If you express the matrix properly as a 4 x 4 matrix,
det([a;b;c;d]),
matlab will give you its determinant. Your expression
[a b c d]
is that of a 1 x 16 row vector and it is meaningless to speak of its "determinant".
However, you don't need matlab to find the determinant you apparently have in mind. Of the twenty-four products that comprise this determinant, only one is non-zero and that will be the product of the four 1's, giving you a resultant determinant value of 1.

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by