用MATLAB解矩阵方程的例子
用MATLAB解矩阵方程例子A=sym('[-k^2*m1+j*k+1 -j*k-1;-j*k-1 -k^2*m2]');
B=sym('[s3;s2]');
C=sym('[k^2*m1*s4;k^2*m2*s4]');
B=A\C
[s3,s2]=solve('((-k^2*m1+j*k+1)*s3-(j*k+1)*s2)=k^2*m1*s4',...
'(-(j*k+1)*s3+(-k^2*m2+2*j*k+2)*s2)=k^2*m2*s4')
s3 =
k^2*s4*(-m2*k^2*m1+m2*j*k+m2+m1*j*k+m1)/(k^4*m2*m1-k^3*m2*j-k^2*m2-2*k^3*m1*j-2*k^2*m1+j^2*k^2+2*j*k+1)
s2 =
(2*m1+m2*j*k+m2-m2*k^2*m1+2*m1*j*k)*k^2*s4/(k^4*m2*m1-k^3*m2*j-k^2*m2-2*k^3*m1*j-2*k^2*m1+j^2*k^2+2*j*k+1)