点除与矩阵除法
来源:互联网 发布:linux 进程启动时间 编辑:程序博客网 时间:2024/05/29 15:06
点除与矩阵除法:
在书写程序的时候,点乘和矩阵乘法写错的时候再进行程序调适的
时候MATLAB会返回错误说明。
但是对于点除容易出现问题,下面以一个简单的例子说明这个问题:
比如我们要计算:
A = [1,1];
B = [2,1];
C = A/B;
上面的程序我们计算的是A与B的点除。但是由于疏忽而把点除“./”
写为“/”这样结果是不同的,大家可以看看它们的结果:
>> A/B
ans =
0.6000
>> A./B
ans =
0.5000 1.0000
它们的结果明显不同,而用“/”去代替“./”将在以后的计算中引
起误差,程序语法错误很难调适。我们只能从期望的结果来检查程
序。希望网友在书写向量或者矩阵的“点除”和“除法”运算的时
候注意这一点。
下面我们看一下“A/B”的结果是怎么计算的(这里提供一段MATLAB
文档):
/ Slash or matrix right division. B/A is roughly the same
as B*inv(A). More precisely, B/A = (A'/B')'. See /.
/ Backslash or matrix left division. If A is a square matrix,
A/B 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 AX = B computed by
Gaussian elimination (see Algorithm for details). A warning
message prints if A is badly scaled or nearly singular.
If A is an m-by-n matrix with m ~= 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 AX = B. The effective rank,
k, of A, is determined from the QR decomposition with pivoting
(see "Algorithm" for details). A solution X is computed which has
at most k nonzero components per column. If k < n, this is usually
not the same solution as pinv(A)*B, which is the least squares
solution with the smallest norm, ||X||.
也就是说A/B和A*pinv(B)输出的结果是一样的,如:
>> A=[1,2,3];B=[1,2,1];A/B,A*pinv(B)
ans =
1.3333
ans =
1.3333
- 点除与矩阵除法
- 点除与矩阵除法
- MATLAB 矩阵的除法理解:左除,右除,逆矩阵
- matlab 点除与除的区别
- Matlab与线性代数 -- 矩阵的左除
- Matlab与线性代数 -- 矩阵的右除
- 大数除法(模拟除)
- matlab 矩阵除法
- MATLAB中点除点除
- PCL点云变换与移除NaN
- 高精度除法(大数相除)
- 【9111】高精度除法(高精度除高精度)
- 高精度除法(高除高)
- python基础--除法、地板除、取余
- 串行除法与并行除法
- 矩阵的点乘与叉乘
- matlab矩阵乘法与矩阵点乘法的规则区别
- Matlab点除和除的区别
- saltstack学习汇总
- [李景山php]每天laravel-20160910|Filesystem-1
- POJ 1654 Area
- Js图片连续左右滚动
- Android Studio常用快捷键(持续更新)
- 点除与矩阵除法
- JS图片切换,带缩略图版
- java-----容器类总结之ArrayList与LinkedList的区别
- Js拖动特效,一串水晶球(很强大)
- 工作五年总结
- Android Studio中设置作者和创建日期等注释模板
- ERROR:transport error 202: gethostbyname: unknown host
- 深入JVM锁机制-synchronized
- 操作xml文档的通用方法