网站大量收购独家精品文档,联系QQ:2885784924

matlab效率(matlab效率).doc

  1. 1、本文档共11页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
matlab效率(matlab效率)

matlab效率(matlab效率) Students Bowen, benefit from the collection here. - Ive been talking about theory before, and to avoid being a pure theory blog, talk about the most experimental part of this: coding. Matlab is the most widely used software in numerical computation and simulation. It is convenient and efficient, and you can usually convert pseudo code algorithms into matlab code directly. But at the same time, matlab also has a lot of performance traps. For example, for statements that are critical. In MATLAB, there are at least two ways to add an array of each element to 1., one from the generic programming language for, i=1:length (a), a (I), =a (I), +1, end, and the other to learn from the mathematical notation a=a+1. But in MATLAB, the performance of the two implementation is very different. Although the MATLAB in the continuous optimization of the implementation of for, but even matlab 2010b on my laptop (Core 2 Duo 2.4 GHz, 4GB, Win7), for a one-dimensional array of 100 thousand elements, the first to achieve 5 microseconds, while the second only 0.4 delicate. The latter is 10 times faster. In fact, using MATLAB, youll find that MATLABs own functions usually have very high performance. For example, just mentioned a=a+1, or sorting sort (a), as well as commendable matrix multiplication, SVD decomposition, and so on. In fact, for two matrices A and B, if you simply implement with three layers of for loops (using C), the performance will definitely be much worse than matlab. Although the Matlab interface is implemented with java to facilitate cross platform, performance is not satisfactory, but the kernel is implemented with C. Try the command matlab -nojvm. For matrix operations, Matlab is called a highly optimized BLAS/LAPACK library. For example, the general matrix multiplication provided by BLAS level3, it will be split into many small pieces of the matrix, make full use of memory continuity, CPUs cache architecture, multi-threaded, etc. to optimize the imp

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档