Update: You can also use Part
Det[mat[[#, #]]] & /@ Reverse[Subsets[Range[Length@mat] , {3}]]
(* {-36, -288, -252, -24} *)
Grid[{MatrixForm@#, Det@#} & /@ (mat[[#, #]] & /@
Reverse[Subsets[Range[Length@mat] , {3}]]), Dividers -> All]
Determinants of 2X2
submatrices on the diagonal:
Grid[{MatrixForm@#, Det@#} & /@ (mat[[#, #]] & /@
Reverse[Subsets[Range[Length@mat] , {2}]]), Dividers -> All]
Original post:
mat = Table[i^2 + i j + j^3, {i, 4}, {j, 4}]
Det[Drop[mat, {#}, {#}]] & /@ Range[Length@mat]
{-36, -288, -252, -24}
Timings for random 100X100
real and integer matrices:
tstmat = RandomReal[100, {100, 100}];
(res1 = Det[Drop[tstmat, {#}, {#}]] & /@ Range[Length@tstmat]); // AbsoluteTiming // First
(* 0.156253 *)
(res2 = Diagonal@Minors[tstmat]); // AbsoluteTiming // First
(* 1.596787 *)
res1 == Reverse@res2
(* True *)
tstmat2 = RandomInteger[100, {100, 100}];
(res1 = Det[Drop[tstmat2, {#}, {#}]] & /@ Range[Length@tstmat2]); // AbsoluteTiming // First
(* 1.234382 *)
(res2 = Diagonal@Minors[tstmat2]); // AbsoluteTiming // First
(* 125.368340 *)
res1 == Reverse@res2
(* True *)
Diagonal
instead ofIdentity
in your second example ? $\endgroup$