else

else is used in if-else statements and is executed when the if condition is not satisfied.

Syntax

else (expression, ...)

Inputs

expression
Type: Any expression.

Example

a = 1;
if a == 3
    b = 4;
elseif a == 2
    b = 7;
else
    b = -a;
end
printf('The value of b is %d', b)
The value of b is -1