next up previous contents
Next: Vectors and Matrices (2) Up: Programming Previous: Loops

Jumps

return, continue, break
A function may be prematurely left using return. continue and break are used in loops: continue jumps back to the start of the loop, and begins another cycle. break permanently leaves the loop.
>> x=1;
>> while( 1 ) 
>    if(x>1000) 
>       break; 
>    end 
>    x++; 
> end
>> x
x = 1001



Helmut Dersch
2009-03-15