x=1;while exp(x)<>%inf ; x=x+1;end /// \sleftarrow {\begin{minipage}[t]{5cm}{\nf{}a simple \verb+while+ with a scalar condition }\end{minipage}} [exp(x-1),exp(x)]==%inf /// \sleftarrow{\normalfont checks result} x=[1:3];while exp(x)<>%inf ; x=x+1;end /// \sleftarrow {\begin{minipage}[t]{5cm}{\nf{}a simple {while} with matrix condition}\end{minipage}} exp(x)==%inf /// \sleftarrow{\normalfont one entry is \verb+%inf+} x=1; while %t /// \sleftarrow{\normalfont infinite loop, need a \verb+break+ to quit the \verb+while+} if exp(x)== %inf then /// \sleftarrow{\normalfont quit the loop when \( \exp(x) \) equals \( \infty\)} break; end x=x+1; end [exp(x-1),exp(x)]==%inf /// \sleftarrow{\normalfont checks result}