Symbolic Math

Matlab is capable of doing fairly simple symbolic math analysis (ie giving you symbolic equations as results rather than matrices or vectors.) It is designed for numerical work, rather than symbolic work, and in order to do symbolic math Matlab actually uses the engine for another math software product, Maple. If you find that what you're trying to do in matlab's symbolic math toolkit involves mostly calling the "maple" command (which simulates Maple), you probably just want to go ahead and use Maple. For basics, though, the symbolic math toolkit is useful.

A symbolic equation in matlab is represented as a string, such as 'x + 2 = 5'. The basic symbolic math operations all take string equations as arguments, and return string equations. Matlab decides which variable in that string is the symbolic variable (as opposed to a variable that actually has a numerical value in its workspace) by assuming that the one-letter variable closest to the end of the alphabet is the symbolic variable. Basic symbolic functions include

symadd('x^2 + 2*x + 3','3*x+5')
symsub, symdiv, symmul, and sympow all work as you would expect, too. Matlab also has symbolic functions such as int and diff to integrate and differentiate, factor to factor, simplify to simplify an expression, and taylor to generate a taylor series expansion.

You can also use solve to solve algebraic equations, and dsolve to solve a differential equation. Using something like this gets very complicated very quickly.

The function numeric('symbolic expression') lets you convert a symbolic representation to numbers wherever possible, which also helps in simplification.

The function ezplot('symbolic function') takes a symbolic equation and plots it as a function of x. You can specify a range or let it use the default. To specify a range, use ezplot('symbolic function',[xmin xmax]').

For more details on the symbolic toolkit, try "help sym", or try reading the manual.