| MATLAB Function Reference | ![]() |
Conditionally execute statements
Syntax
ifexpressionstatementselsestatementsend
Description
The else command is used to delineate an alternate block of statements.
ifexpressionstatementselsestatementsend
The second set of statements is executed if the expression has any zero elements. The expression is usually the result of
expression ropexpression
where rop is ==, <, >, <=, >=, or ~=.
See Also
break, elseif, end, for, if, return, switch, while
| ellipke | elseif | ![]() |