Chapter 3

Selection Statements

Contents

Key Terms

selection statements

branching statements

condition

relational expression

Boolean expression

logical expression

relational operators

logical operators

truth table

action

temporary variable

error-checking

nesting statements

cascading if-else

“is” functions

In the scripts and functions we've seen thus far, every statement was executed in sequence. That is not always desirable, and in this section we'll see how to make choices as to whether statements are executed or not, and how to choose between or among statements. ...

Get Matlab: A Practical Introduction to Programming and Problem Solving, 2nd Edition 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.