I want to get vector of det
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
-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 Kommentar
Jan
am 28 Jul. 2013
Bearbeitet: Jan
am 28 Jul. 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.
Akzeptierte Antwort
Roger Stafford
am 28 Jul. 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.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Quantum Mechanics finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!