Symbolic Math Toolbox    

Creating Symbolic Math Functions

There are two ways to create functions:

Using Symbolic Expressions

The sequence of commands

generates the symbolic expressions r, t, and f. You can use diff, int, subs, and other Symbolic Math Toolbox functions to manipulate such expressions.

Creating an M-File

M-files permit a more general use of functions. Suppose, for example, you want to create the sinc function sin(x)/x. To do this, create an M-file in the @sym directory:

You can extend such examples to functions of several variables. See the MATLAB topic Programming and Data Types for a more detailed discussion on object-oriented programming.


  Symbolic and Numeric Conversions Using the Symbolic Math Toolbox