Calq commands and keywords

Keyword

if

Definition

This keyword specifies a conditional statement. The condition, after the keyword if, is evaluated. When the condition evaluates to a true value, then the statements starting on the next line are executed. When the condition evaluates to false, execution resumes after the else keyword, or after the end keyword if there is no else part.

Example

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

See also

else, elseif, and end.


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