加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

matlab中左除和右除的区别

(2012-03-18 19:59:22)
标签:

杂谈

分类: 技术

在matlab中有两种除法:/和\,那么它们有什么区别呢?看了几本书,上面没有说或者是没有说明白,其实很简单,我们可以从英文帮助中查到:

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.

   所以:A/B=A*inv(B);


     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')'.

所以:A\B=inv(A)*B;

他们之间的关系为:

A/B = (B'\A')'.

看来还是英文帮助比较实用.

举例如下:

    >> a=magic(3)

a =

              6
              7
              2

>> b=pascal(3)

b =

              1
              3
              6

>> a/b

ans =

     27    -31     12
              0
    -13     29    -12

>> a*inv(b)

ans =

     27    -31     12
              0
    -13     29    -12

>> a\b

ans =

     0.0667     0.0500     0.0972
     0.0667     0.3000     0.6389
     0.0667     0.0500    -0.0694

>> inv(a)*b

ans =

     0.0667     0.0500     0.0972
     0.0667     0.3000     0.6389
     0.0667     0.0500    -0.0694

>> a/b-(b'\a')'

ans =

              0
              0
              0

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有