compare loops and matrix computation.

8 ビュー (過去 30 日間)
C Zeng
C Zeng 2013 年 5 月 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 日
  1 件のコメント
C Zeng
C Zeng 2013 年 5 月 30 日
Thanks, Jonathan!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by