矩阵乘法问题 (答的好有加分)

来源:百度知道 编辑:UC知道 时间:2024/05/15 19:05:09
A*B=C假设A,B,C都是方阵,已知A和C,则B=INV(A)*C,但是假设A,B,C都不是方阵,已知A和C怎样求B呢?在MATLAB里又怎样运算?假设A(4,2),B(2,5)
C(4,5)

A is not necessary to be square matrix. Then there does not exist the inverse of A. However, you can use pseudo inverse instead. In MATLAB, the function is pinv(A). For example,

>> a=[2 5;3 7;4 9];
>> b=[4 2;12 6];
>> c=a*b;
>> b=pinv(a)*c

b =

4.0000 2.0000
12.0000 6.0000

至少A是方阵,否则没法求逆,对不?
例如:
A =

8 1 6
3 5 7
4 9 2

C=

1
2
3

>> B=inv(A)*C

B =

0.05000000000000
0.30000000000000
0.05000000000000

这不就是求解线性方程组吗?