Chapter 8. Loops

In Chapter 2 we introduced the powerful for statement, which is used to repeat a block of statements a fixed number of times. This type of structure, where the number of repetitions must be determined in advance, is sometimes called determinate repetition. However, it often happens that the condition to end a loop is only satisfied during the execution of the loop itself . Such a structure is called indeterminate. We begin with a discussion of determinate repetition.

Determinate Repetition with for

In this section several applications of determinate loops are described.

Binomial coefficient ...

Get Essential MATLAB for Engineers and Scientists Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.