O'Reilly logo

MATLAB® by Example by Francis Lilley, Munther Gdeisat

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

6

Conditional Statements in Matlab

Chapter Outline

Lesson 6.1 The Construction of an if Statement

Lesson 6.2 The Construction of an if else Statement

Lesson 6.3 Recursive Functions

Lesson 6.4 The Construction of an if elseif else Statement

Lesson 6.5 The Construction of a switch case Statement

Answers to Selected Exercises

Lesson 6.1 The Construction of an if Statement

Objectives

• To learn how to exchange the values of two variables.

• To learn how to construct an if statement.

• To learn how to improve the readability of Matlab functions.

Topics

6.1.1 Swap the Values of Two Variables

6.1.2 if Statement

6.1.3 Improving the Readability of Matlab Functions

6.1.4 Examples for if Statements

6.1.1 Swap the Values of Two Variables

The figure ...

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