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 in the online MATLAB documentation for a more detailed discussion on object-oriented programming.


  Creating Abstract Functions Using the Symbolic Math Toolbox 

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS