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

5

Matlab Functions

Chapter Outline

Lesson 5.1 Introduction to Functions

Lesson 5.2 Creating Functions

Lesson 5.3 Scope of Matlab Variables in a Function

Answers to Selected Exercises

Lesson 5.1 Introduction to Functions

Objectives

• To learn about functions in Matlab.

• To understand the purpose of a function.

• To learn how to call a function.

Topics

5.1.1 What Is a Function?

5.1.2 The Purpose of a Function

5.1.2.1 Improves Code Readability

5.1.2.2 Improves Code Reusability

5.1.2.3 Modifying Code

5.1.3 Calling a Matlab Function

5.1.1 What Is a Function?

A Matlab function is a collection of commands that does a specific task and must have a unique name. The function accepts one or more Matlab variables as input arguments, operates on ...

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