AdjointMatrix[M_] := Module[{Ma, B, n, i, j}, Ma = Minors[M];
B = Ma;
n = Dimensions[M][[1]];
For[i = 1, i <= n, i++,
For[j = 1, j <= n, j++,
B[[i, j]] =
Ma[[n + 1 - i,
n + 1 - j]]*(-1)^(i + j);];(*inner for*)];(*outer for*)
Transpose[B]];
时间: 2024-09-29 22:06:41