Filter löschen
Filter löschen

compare loops and matrix computation.

10 Ansichten (letzte 30 Tage)
C Zeng
C Zeng am 30 Mai 2013
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.

Akzeptierte Antwort

Jonathan Sullivan
Jonathan Sullivan am 30 Mai 2013

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by