Any line with an open bracket " [ " is
a calculation line. Work in calculation lines will appear in red text and their answers will appear in blue text. All other lines are considered comments and plain text, will appear in plain black text, and will not be executed as functions. A new calculation line can be made by pressing the red pi button, and a new line of text with the blue paragraph button.
Pressing [Enter] after a line of code will execute that code (in a calculation line). You can change code at any time, and re-calculate it by going to it and pressing [Enter] again. Or if you have several lines to run at once, the first few choices under the drop-down menu "Notebook" will give you options for how to re-run your code after making changes.
For instance, you can select to only run a section of your code instead of all of it.
Try typing into the top text line and executing a simple calculator function:
This is a test
From this point onward, I will drop the brackets before a calculation line to make the command text easier to copy and paste into your own MuPAD. MuPAD inputs will appear in red and the corresponding outputs below it are in blue.
In addition to exact symbolic computations, most computer algebra packages can
approximate solutions numerically as well. The user can set the precision to the
desired number of digits. In MuPAD®, the global variable DIGITS handles this.
For example, if you enter the simple command DIGITS:= 100, then MuPAD
performs all floating-point calculations with a precision of 100 decimal digits. Of
course, such computations need more computing time and more storage than the
use of hardware floating-point arithmetic. Here are some examples.
Notice also that, unlike matlab, MuPAD returns the exact answer for sin(PI/3) because by default, MUPAD is not working with floating point numbers. It returns the exact answer to any calculation.
If you want to convert the answer into floating point representation, you need first to define how many decimal places you want to see in your output. This can be accomplished by typing:if you want to have 16 decimal places. For instance, if you want to see floating-point approximation of the previous output (\( \displaystyle \sin\frac{\pi}{3} \) ), just type:
The output will be the same
0.86602540378443864
MuPAD knows many special functions. For example,