This keyword is used within an if statement to indicate the end of the body of commands to execute when the condition is met, and the beginning of a new (optional) condition statement. It is very similar to a nested if-statement, but else-if extends the current if statement, and thus does not need another end statement.
if (sqrt(3) > 2)
disp('Square root of 3 is greater than 2.');
elseif (sqrt(3) == 2)
disp('Square root of 3 is equal to 2.');
else
disp('Square root of 3 is less than 2.');
end