MATLAB: I want to get vector of det

det

-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?

Best Answer

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.