compare loops and matrix computation.

15 次查看(过去 30 天)
Hi, all,
I recently found that Matlab executes matrix/vector computation pretty fast than scalar computation with loops. For example, if I used loops to execute algorithm, it is very slow. If I convert it to vector or matrix, it is faster.
I was told about this fact before, is there any explanation on it?
The bad thing is that you cannot always use matrix to replace loops...
Thanks.

采纳的回答

Jonathan Sullivan
Jonathan Sullivan 2013-5-30

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by