Symbolic Math in MATLAB
Symbolic math expressions can be created in MATLAB. This tool is quite effective when you have a math problem to work on but you do not know how to process it or you do not want to compute an answer immediately. MATLAB supports several symbolic operations in a myriad of areas including:
- Calculus - covers differentiation, integration, Taylor series, summation, and limits
- Algebraic and differential equations
- Linear algebra – topics covered under this include inverses, eigenvalues, determinants, singular value decomposition and canonical forms of symbolic matrices
- Transforms such as Fourier, Laplace, corresponding inverse transforms, and z-transform.
- Simplification which covers methods of simplifying algebraic expressions
- The solution of equations which includes topics such as symbolic and numerical solutions to algebraic expressions
- Variable precision arithmetic which covers the numerical evaluation of mathematical expressions to any specified accuracy.
- Special mathematical functions which include special functions of classical applied mathematics.
The syms or sym() are the key functions in MATLAB that are used to create a symbolic representation of data when we have multiple symbols to make. The Kernel of Maple is the computational engine underlying the symbolic math toolboxes in MATLAB. The versions of these toolboxes are designed to work with MATLAB 5 and Maple v release 4.
MATLAB has two symbolic math toolboxes:
1. The basic symbolic math toolbox
It is a collection of more than one hundred MATLAB functions. This toolbox provides access to the Maple kernel using a style and syntax that is a natural extension of the MATLAB language.
2. The Extended symbolic math toolbox
This toolbox augments the functions of the first toolbox to allow access to non-graphics Maple’s packages. Programming features and user-defined procedures.
Getting Help
You can avail of our symbolic math in MATLAB assignment help if you are struggling with the task allotted to you. We have symbolic math tutors who possess great knowledge of both the MATLAB tool and the topic.
If you decide to handle the assignment on your own, there are two ways of how to find information on how to use symbolic math toolbox functions. First, you can read this article. Second, you can use MATLAB’s command line help system. To obtain help on MATLAB functions, simply type help function. You should replace the function with the name of the MATLAB function that you need help with. This method is not, however, sufficient for some symbolic math functions. This is because several numeric functions are overloaded by the symbolic math toolbox. In simple terms, MATLAB uses the same function name to provide a symbolic specific implementation of the functions.
You should type the following command if you need help with the symbolic version of an overloaded function: help sym/function. The function in the command is the name of the overloaded function. For example, help sym/diff is a command that can be used to obtain help on the symbolic version of the overloaded, diff, type. On the other hand, if you need information on the numeric version, you can just type help diff.
So how can you tell that a function is overloaded? Well, the help command for the numeric version will tell you. For example, these are the sections contained in the help for the diff function:
- Overloaded methods
- Help char/diff.a
- Help sym/diff.a
From this, you can see that there are two other diff commands that operate on expressions of class char and class sym respectively.
Getting Started
In this section, we are going to briefly discuss how to create and use symbolic objects. If you were used to the version one of the symbolic math toolboxes, you would be happy to know that version two is substantially different and has a simpler syntax. You should not fret if you have never used the symbolic math toolbox. MATLAB offers a quick online introduction to the symbolic math toolbox. On the MATLAB command line, simply type demos. A dialog box with all the MATLAB demos will be displayed. On the left checklist box, select symbolic math and then introduction on the right drop-down menu.
A new MATLAB data type called symbolic object or sym is defined by this toolbox. We can see a symbolic object as a data structure that stores a string of representation on the symbol. These objects are used to represent symbolic variables, matrices, and expressions.
Creating symbolic variables and expressions
You can construct symbolic variables and expressions using the sym command. For example, to create a symbolic variable ‘a’ that prints alpha, you can use the command below:
a = sym(‘alpha’)