19. The Symbolic Math Toolbox

Society for Industrial and Applied Mathematics eBooks · 2005

The Symbolic Math Toolbox is one of the many toolboxes that extend the functionality of MATLAB, and perhaps the one that does so in the most fundamental way. The toolbox is provided with the MATLAB Student Version, but must be purchased as an extra with other versions of MATLAB. You can tell if your MATLAB installation contains the toolbox by issuing the ver command and seeing if the toolbox is listed. The toolbox is based upon the Maple® kernel, which performs all the symbolic and variable precision computations. Maple is a symbolic manipulation package produced by Waterloo Maple, Inc. To obtain an overview of the functions in the toolbox type help symbolic. 19.1. Equation Solving The Symbolic Math Toolbox defines a new datatype: a symbolic object, denoted by sym. Symbolic objects can be created with the sym and syms commands. Suppose we wish to solve the quadratic equation ax2 + bx + c = 0. We define symbolic variables: ≫ syms a b c x ≫ whos NameSizeBytesClassa1×1126sym objectb1×1126sym objectc1×1126sym objectx1×1126sym object Grand total is 8 elements using 504 bytes The same effect can be achieved using ≫ a = sym (‘a’); b = sym (‘b’); c = sym (‘c’); x = sym (‘x’); We recommend using the shorter syms form.

Read the paper · More papers on PaperTik