O'Reilly logo

Matlab: A Practical Introduction to Programming and Problem Solving, 2nd Edition by Stormy Attaway

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4

Loop Statements

Contents

Key Terms

looping statements

counted loops

conditional loops

action

iterate

loop or iterator variable

running sum

running product

factorial

preallocate

echo printing

nested loop

outer loop

inner loop

infinite loop

counting

error-checking

Consider the problem of calculating the area of a circle with a radius of 0.3 centimeters. A MATLAB® program certainly is not needed to do that; you'd use your calculator instead, and punch in π * 0.32. However, if a table of circle areas is desired, for radii ranging from 0.1 centimeters to 100 centimeters in steps of 0.05 (e.g., 0.1, 0.15, 0.2, etc.), it would be very tedious to use a calculator and write it all down. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required