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 O’Reilly online learning.

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