hi,
does matlab program inside a if loop always executed sequentially ?

3 Kommentare

Alex
Alex am 21 Nov. 2011
What do you mean by an "if loop". Please give an example
Sean de Wolski
Sean de Wolski am 21 Nov. 2011
If you tell it to!
Walter Roberson
Walter Roberson am 8 Dez. 2011
There is no such thing as an if loop.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 21 Nov. 2011

1 Stimme

No, the Just In Time (JIT) compiler can end up reordering some portions of the code.

1 Kommentar

Jan
Jan am 21 Nov. 2011
Reordering does not mean, that the program is not executed sequentially. The parallelized functions like FILTER, MIN, SUM etc will process the data with multiple threads. On the processor level a branch prediction is applied also.
Therefore I agree with Walter and add the argument, that "sequential execution" is not exactly defined on modern processors.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by