Chapter 9

Expanding MATLAB’s Power with Functions

In This Chapter

arrow Finding and using built-in functions

arrow Defining and using your own functions

arrow Understanding other function types

Simplification is an important part of creating any useful application. The better you can outline what tasks the application performs in the simplest of terms, the easier it is to define how to interact with and expand the application. Understanding how an application works is the reason you use functions. A function is simply a kind of box in which you put code. The function accepts certain inputs and provides outputs that reflect the input received. It isn’t important to understand precisely how the function performs its task unless your task is to modify that function, but being able to visualize what task the function performs helps you understand the application as a whole. The only requirement is that you understand the inputs and resulting outputs. In short, functions simplify the coding experience.

This chapter is about three sorts of functions. You have already used quite a few built-in functions, but simply using them may not be enough. You need to understand a little more about the inputs and ...

Get MATLAB For Dummies now with O’Reilly online learning.

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