关于matlab中矩阵运算A/B的疑问A/B按我的解释应该是A乘以B的逆矩阵,这样的话B必须是一个方阵才可逆呀!可是我运行时出现:>> a=[1;2;3;4;5;6];>> b=a;>> a/bans =0 0 0 0 0 0.16670 0 0 0 0 0.33330 0 0 0 0 0.50000 0 0

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/12 16:46:53
关于matlab中矩阵运算A/B的疑问A/B按我的解释应该是A乘以B的逆矩阵,这样的话B必须是一个方阵才可逆呀!可是我运行时出现:>> a=[1;2;3;4;5;6];>> b=a;>> a/bans =0 0 0 0 0 0.16670 0 0 0 0 0.33330 0 0 0 0 0.50000 0 0

关于matlab中矩阵运算A/B的疑问A/B按我的解释应该是A乘以B的逆矩阵,这样的话B必须是一个方阵才可逆呀!可是我运行时出现:>> a=[1;2;3;4;5;6];>> b=a;>> a/bans =0 0 0 0 0 0.16670 0 0 0 0 0.33330 0 0 0 0 0.50000 0 0
关于matlab中矩阵运算A/B的疑问
A/B按我的解释应该是A乘以B的逆矩阵,这样的话B必须是一个方阵才可逆呀!
可是我运行时出现:
>> a=[1;2;3;4;5;6];
>> b=a;
>> a/b
ans =
0 0 0 0 0 0.1667
0 0 0 0 0 0.3333
0 0 0 0 0 0.5000
0 0 0 0 0 0.6667
0 0 0 0 0 0.8333
0 0 0 0 0 1.0000
运算的结果是6维的矩阵,这并不是什么点除呀!再者:
>> a=[1;2;3;4;5;6];
>> b=[4;2;6;4;5;6];
>> a/b
ans =
0 0 0.1667 0 0 0
0 0 0.3333 0 0 0
0 0 0.5000 0 0 0
0 0 0.6667 0 0 0
0 0 0.8333 0 0 0
0 0 1.0000 0 0 0
>> a=[1;2;3;4;5;6];
>> b=[4;2;6;4;5;6];
>> a/b
ans =
0 0 0.1667 0 0 0
0 0 0.3333 0 0 0
0 0 0.5000 0 0 0
0 0 0.6667 0 0 0
0 0 0.8333 0 0 0
0 0 1.0000 0 0 0
还有行向量的运算:
>> a=[1 2 3 4 5 6];
>> b=[4 5 5 4 5 6];
>> b/a
ans =
1.1978
看不懂,就是不清楚这些结果如何算出来的,拒绝无意义的回答!

关于matlab中矩阵运算A/B的疑问A/B按我的解释应该是A乘以B的逆矩阵,这样的话B必须是一个方阵才可逆呀!可是我运行时出现:>> a=[1;2;3;4;5;6];>> b=a;>> a/bans =0 0 0 0 0 0.16670 0 0 0 0 0.33330 0 0 0 0 0.50000 0 0
matlab里的'/'不完全等于矩阵除法.
你可以用help mrdivide看一下'/'的帮助:
>> help mrdivide
/ Slash or right matrix divide.
A/B is the matrix division of B into A, which is roughly the
same as A*INV(B) , except it is computed in a different way.
More precisely, A/B = (B'\A')'. See MLDIVIDE for details.
就是说A/B可以大致看成A*inv(B),但用的是另一种方法.更确切的讲A/B = (B'\A')'.
那再看看'\'(左除或者反除)是什么东东.
>> help mldivide
\ Backslash or left matrix divide.
A\B is the matrix division of A into B, which is roughly the
same as INV(A)*B , except it is computed in a different way.
If A is an N-by-N matrix and B is a column vector with N
components, or a matrix with several such columns, then
X = A\B is the solution to the equation A*X = B computed by
Gaussian elimination. A warning message is printed if A is
badly scaled or nearly singular. A\EYE(SIZE(A)) produces the
inverse of A.

If A is an M-by-N matrix with M < or > N and B is a column
vector with M components, or a matrix with several such columns,
then X = A\B is the solution in the least squares sense to the
under- or overdetermined system of equations A*X = B. The
effective rank, K, of A is determined from the QR decomposition
with pivoting. A solution X is computed which has at most K
nonzero components per column. If K < N this will usually not
be the same solution as PINV(A)*B. A\EYE(SIZE(A)) produces a
generalized inverse of A.
就是说当A是N阶方阵B为N行的列向量时,X=A\B就是线性方程组A*X=B的解,算法是用高斯消去法.A\EYE(SIZE(A))产生的是方阵A的逆矩阵.
如果A是M*N的矩阵且M≠N,B是跟A行数(M行)相同的列向量时,X=A\B是非满秩的线性方程组A*X=B的解系,A的秩K由QR分解得出.如果K> A=pascal(3) %A赋值为3*3的方阵.
A =
1 1 1
1 2 3
1 3 6
>> b=[1:3]' % b是3*1的列向量.
b =
1
2
3
>> x=A\b % 用反除求Ax=b的解,结果x是个列向量,注意是A\b不是b\A
x =
0
1
0
>> A*x % 验证一下A*x刚好等于b
ans =
1
2
3
>> x=b'/A' % 这回是正除了,不过b'是行向量,A'也倒一下,正除的时候就是b'/A'了,不是A'/b'了,结果x是个行向量
x =
0 1 0
>> x*A' % 验证一下,跟b'一样.
ans =
1 2 3
>> A=rand(3,4) % 这回重新赋值,A不是方阵了,是3*4的矩阵
A =
0.5298 0.3798 0.4611 0.0592
0.6405 0.7833 0.5678 0.6029
0.2091 0.6808 0.7942 0.0503
>> x=A\b % 实际上方程组没有唯一确定的解,而是无数解,所以解出来的是一个特解
x =
-1.5132
4.9856
0
-1.5528
>> A*x % 验证,跟b相等.
ans =
1.0000
2.0000
3.0000
>> A=rand(3,2) % 再看看3*2的矩阵,行数>列数的情况
A =
0.4154 0.0150
0.3050 0.7680
0.8744 0.9708
>> x=A\b
x =
1.8603
1.5902
>> A*x % 验证一下,嗯?怎么不等于b了?
ans =
0.7966
1.7886
3.1704
% 为什么呢?因为方程数(行数)太多,未知数(列数)个数太少,2个未知数,用2个线性无关的方程就可以求确定的解了,现在方程多了,不能同时满足所有方程,所以实际上是无解,只不过matlab里用的是一个最小二乘意义上的近似解,所以验证时不等,只是尽可能近似的满足所有方程.

关于matlab中矩阵的运算比如有三个矩阵A,B,M,且A*B=M,已知A和M,怎么能求出B矩阵,麻烦也附上matlab的程序 描述在Matlab中矩阵运算的含义,如A*B,A.*B表示什么运算过程? 关于matlab中矩阵运算A/B的疑问A/B按我的解释应该是A乘以B的逆矩阵,这样的话B必须是一个方阵才可逆呀!可是我运行时出现:>> a=[1;2;3;4;5;6];>> b=a;>> a/bans =0 0 0 0 0 0.16670 0 0 0 0 0.33330 0 0 0 0 0.50000 0 0 矩阵运算中A'是什么意思?就是普通运算 不是MATLAB之类的语法 matlab矩阵运算 A(B ,:MATLAB里面A(B,:其中A是150*2矩阵,B为150*1矩阵, matlab关于矩阵运算的A为一个矩阵,请问▽A表示是个什么意思?应该如何计算? matlab中矩阵a╲b是什么意思 matlab中矩阵A,子矩阵B,如何求得剩余构成矩阵C的问题 如何计算矩阵A关于矩阵B的广义特征值(matlab实现) MATLAB矩阵的运算:A为一6*4矩阵,B也为6*4矩阵,B(A)为什么操作?rt 在matlab中如何标识出两矩阵中元素相等的位置输入如下两个矩阵 A 和 B,对矩阵 A 和 B 作关系运算,标识出两矩阵中元素相等的位置,元素值不等的位置,并标识出矩阵 A 中所有小于 0 的元素.a=[1 2 请问 matlab中矩阵 A.' MATLAB中矩阵A^0. matlab里,矩阵A&B是什么运算?还有A./B是啥意思 matlab中max([A B])求的是什么?其中A和B为矩阵 矩阵函数 Matlab假设A是个矩阵,矩阵的乘方运算A^3是区别于点乘A.^3的,然后相应的矩阵函数exp(A), sin(A), cos(A)等都可以通过Taylor展开,再用矩阵的乘方运算来求,但Matlab中直接对矩阵使用exp, sin, cos 在matlab中求矩阵运算:A-B=6A+BA,其中A=【3 0 0;0 4 0;0 0 7】,求B 求教, 关于matlab中的矩阵幂a^b的结果为什么是这样?