Logo Background

elseif

  • Written by matlabtutorialsmatlabtutorials No Comments Comments
    Last Updated: March 6, 2008

    IF statement condition.
    is used with IF. The statements after the are
    executed if the expression is true and all the preceding IF and
    expressions are false. An expression is considered true if
    the real part has all non-zero elements.

    does not need a matching END, while ELSE IF does.

    The general form of the IF statement is
    IF expression
    statements
    expression
    statements
    ELSE
    statements
    END

    See also if, else, end.