Home » MATLAB if-elseif-else…end statement

MATLAB if-elseif-else…end statement

by Online Tutorials Library

MATLAB if-elseif-else…end statement

If we have more than one option or condition to check, then use elseif keyword.

Syntax:

Flowchart of if…elseif… else…end Statements

MATLAB if-elseif-else...end statement

Example1:

Output:

n = 9  you are younger  

You may also like