ABSTRACT

This chapter focuses on functions and their associated graphs. It provides examples of commonly used mathematical functions: piecewise, step, parametric, and polar. The chapter broadens the use of function by using the geometric definition to obtain a parabola, discuss functions that return functions, and create a function that returns Pythagorean triples. A piecewise function can be defined using an ifelse statement within function. The pracma (Practical Numerical Math Functions) package uses ‘MATLAB’ function names where appropriate to simplify porting. In particular, the package has a function to graph in polar coordinates. Functions can be defined to return a function. The chapter provides two examples. The first example defines a function that returns the reflection of function about the origin. In the second example, the function returns an exponential function with the given parameters.