13.01.2015 Views

Chapter 4: Programming with MATLAB - FET

Chapter 4: Programming with MATLAB - FET

Chapter 4: Programming with MATLAB - FET

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

while Loops<br />

The while loop is used when the looping process<br />

terminates because a specified condition is satisfied,<br />

and thus the number of passes is not known in<br />

advance. A simple example of a while loop is<br />

x = 5;<br />

while x < 25<br />

disp(x)<br />

x = 2*x - 1;<br />

end<br />

The results displayed by the disp statement are 5, 9,<br />

and 17.<br />

4-28<br />

Z.R.K

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!