Calq commands and keywords

Keyword

else

Definition

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 the (optional) body of commands to execute when that condition is not met.

Example

  if (sqrt(3) >= 2)
    disp('Square root of 3 is greater than or equal to 2.');
  else
    disp('Square root of 3 is less than 2.');
  end

See also

elseif, end, and if


What is Calq?
Latest version of Calq
Digital Wave Systems Lab homepage