马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
矩阵M为一个8×8的复数方阵,我用det(M)求出的值为
-.17202e28+.80487e-2*i
可是我用行列式的定义的方法求出的值却为
-.1124297554e25+.2345712643e25*i
很奇怪,两者的值差别很大。不知道究竟哪个值才是正确的?另外,我想问一下matlab求复数矩阵的行列式是怎么计算的?和实数一样的处理吗?
以下附矩阵M
Column 1
0 -1.388631098000000e+000i
1.373487414000000e+000 -2.045205351000000e-001i
0 +5.473233054000000e+000i
-5.413544840000000e+000 +8.061093798000000e-001i
0 -1.022401538000000e+002i
1.011251762000000e+002 -1.505814683000000e+001i
4.908771629000000e+008
7.229743031999999e+007 +4.855239136000000e+008i
Column 2
0 +1.388631098000000e+000i
1.373487414000000e+000 +2.045205351000000e-001i
0 -5.473233054000000e+000i
-5.413544840000000e+000 -8.061093798000000e-001i
0 +1.022401538000000e+002i
1.011251762000000e+002 +1.505814683000000e+001i
4.908771629000000e+008
7.229743031999999e+007 -4.855239136000000e+008i
Column 3
0 -8.516758816000000e-002i
-2.501301259000000e-002 -8.141171460000000e-002i
0 -8.580223028000000e-002i
-2.519940171000000e-002 -8.201836913000001e-002i
0 -4.040864364000000e-005i
-1.186768269000000e-005 -3.862663056000000e-005i
8.409365580000000e+005
8.038514244000000e+005 -2.469760758000000e+005i
Column 4
0 +8.516758816000000e-002i
-2.501301259000000e-002 +8.141171460000000e-002i
0 +8.580223028000000e-002i
-2.519940171000000e-002 +8.201836913000001e-002i
0 +4.040864364000000e-005i
-1.186768269000000e-005 +3.862663056000000e-005i
8.409365580000000e+005
8.038514244000000e+005 +2.469760758000000e+005i
Column 5
-3.428909785000000e+000
-2.104301496000000e-005
1.395799629000000e+001
8.565939121000000e-005
3.327269145000000e+002
2.041925241000000e-003
1.061039986000000e+008
6.511539145000000e+002
Column 6
-1.205975479000000e+000
-1.771000737000000e-002
4.751604739000000e+000
6.977833001000000e-002
-3.751887137000000e+001
-5.509726359000000e-001
-2.750086334000000e+008
-4.038560493000000e+006
Column 7
1.205975479000000e+000
8.212175327999999e+001
-4.751604739000000e+000
-3.235638857000000e+002
3.751887137000000e+001
2.554874084000000e+003
-2.750086334000000e+008
-1.872690742000000e+010
Column 8
3.428909785000000e+000
5.587327831000000e+005
-1.395799629000000e+001
-2.274422659000000e+006
-3.327269145000000e+002
-5.421706800000000e+007
1.061039986000000e+008
1.728939696000000e+013
以下是我用来求行列式A的值的程序:
%hanglieshijisuan
ZHENG1=M(1,1)*M(2,2)*M(3,3)*M(4,4)*M(5,5)*M(6,6)*M(7,7)*M(8,8)
ZHENG2=M(1,2)*M(2,3)*M(3,4)*M(4,5)*M(5,6)*M(6,7)*M(7,8)*M(8,1)
ZHENG3=M(1,3)*M(2,4)*M(3,5)*M(4,6)*M(5,7)*M(6,8)*M(7,1)*M(8,2)
ZHENG4=M(1,4)*M(2,5)*M(3,6)*M(4,7)*M(5,8)*M(6,1)*M(7,2)*M(8,3)
ZHENG5=M(1,5)*M(2,6)*M(3,7)*M(4,8)*M(5,1)*M(6,2)*M(7,3)*M(8,4)
ZHENG6=M(1,6)*M(2,7)*M(3,8)*M(4,1)*M(5,2)*M(6,3)*M(7,4)*M(8,5)
ZHENG7=M(1,7)*M(2,8)*M(3,1)*M(4,2)*M(5,3)*M(6,4)*M(7,5)*M(8,6)
ZHENG8=M(1,8)*M(2,1)*M(3,2)*M(4,3)*M(5,4)*M(6,5)*M(7,6)*M(8,7)
ZHENG=ZHENG1+ZHENG2+ZHENG3+ZHENG4+ZHENG5+ZHENG6+ZHENG7+ZHENG8
FU1=M(1,8)*M(2,7)*M(3,6)*M(4,5)*M(5,4)*M(6,3)*M(7,2)*M(8,1)
FU2=M(2,8)*M(3,7)*M(4,6)*M(5,5)*M(6,4)*M(7,3)*M(8,2)*M(1,1)
FU3=M(3,8)*M(4,7)*M(5,6)*M(6,5)*M(7,4)*M(8,3)*M(1,2)*M(2,1)
FU4=M(4,8)*M(5,7)*M(6,6)*M(7,5)*M(8,4)*M(1,3)*M(2,2)*M(3,1)
FU5=M(5,8)*M(6,7)*M(7,6)*M(8,5)*M(1,4)*M(2,3)*M(3,2)*M(4,1)
FU6=M(6,8)*M(7,7)*M(8,6)*M(1,5)*M(2,4)*M(3,3)*M(4,2)*M(5,1)
FU7=M(7,8)*M(8,7)*M(1,6)*M(2,5)*M(3,4)*M(4,3)*M(5,2)*M(6,1)
FU8=M(8,8)*M(1,7)*M(2,6)*M(3,5)*M(4,4)*M(5,3)*M(6,2)*M(7,1)
FU=FU1+FU2+FU3+FU4+FU5+FU6+FU7+FU8,
ZHI=vpa(ZHENG-FU,10)
简单的算例可是我用了一个简单的3×3的复数矩阵A来计算,det(A)的值又能和用行列是定义的方法计算的相同。
为什么8×8的那个却不对,奇怪?
以下是我的算例:
A=[2+i,1+i,3;
2,1,1-i;
4+i,1+2i,1-2i]
AZHENG1=A(1,1)*A(2,2)*A(3,3)
AZHENG2=A(1,2)*A(2,3)*A(3,1)
AZHENG3=A(1,3)*A(2,1)*A(3,2)
AZHENG=AZHENG1+AZHENG2+AZHENG3
AFU1=A(1,3)*A(2,2)*A(3,1)
AFU2=A(2,3)*A(3,2)*A(1,1)
AFU3=A(3,3)*A(1,2)*A(2,1)
AFU=AFU1+AFU2+AFU3
B2=AZHENG-AFU
B1=det(A)
此时B1=B2=-5.000000000000000e+000 +5.000000000000000e+000i
[ 本帖最后由 eight 于 2008-5-13 11:27 编辑 ] |