Calq commands and keywords

Keyword

while

Definition

This keyword is used to make a loop that executes the loop body zero of more times, as long as a condition is met. It is possible for a while loop to never terminate. The end keyword marks the conclusion of the loop body.

Example

  k=1;
  while k <= 3
    disp('hello world');
    k = k + 1;
  end

  m=10;
  while m <= 3
    disp('m is less than 3');
    m = m + 1;
  end

See also

end, for, and if.


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