7.3. Branches Control Structures

The branch control structures allow selecting and executing specific blocks of statements out of many statement blocks depending upon the condition. These include different types of if structures, switch control structure and so on. The if structure is a conditional control structure which allows some group of statements to be executed only if the given condition is true.

7.3.1. if Control Structures

In if control structure, a group of statements are executed only if the condition is true. The following are the different forms of if control structures:

7.3.1.1. if Structure

This is the simplest form of if control structure. It has only ...

Get MATLAB® and Its Applications in Engineering: [Based on MATLAB 7.5 (R2007b)] now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.