Simulink Reference Previous page   Next Page

Control Flow Statements in Embedded MATLAB Functions

Embedded MATLAB functions support the following MATLAB program statements:

Statement
Description
break
break statement
continue
continue statement
for
for statement
if
if statement
The conditions of an if statement cannot use & and | operators. In their place, use the && and || operators, respectively. To logically collapse vectors into scalars, use the function all.
return
return statement
switch
switch statement
while
while statement
The conditions of while statements cannot use & and | operators. In their place, use the && and || operators, respectively. To logically collapse vectors into scalars, use the function all.


Previous page  Operators in Embedded MATLAB Functions Arithmetic Operators in Embedded MATLAB Functions Next page

© 1994-2005 The MathWorks, Inc.