| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Symbolic Math Toolbox |
| Contents | Index |
| Learn more about Symbolic Math Toolbox |
| On this page… |
|---|
Launching, Opening, and Saving MuPAD Notebooks Opening Recent Files and Other MuPAD Interfaces |
There is extensive online help available for MuPAD. You can access the help browser from the MATLAB workspace in a variety of ways:
Enter doc(symengine) at the MATLAB command line to display MuPAD Help.

MuPAD Help contains complete documentation of the MuPAD language. It also explains how to use the various MuPAD interfaces, such as notebooks and the editor.
For help on a specific MuPAD function, enter doc(symengine,'functionName') at the MATLAB command line to display MuPAD Help at the functionName function.
There is also a MuPAD Tutorial PDF file available
at http://www.mathworks.com/access/helpdesk/...
help/pdf_doc/symbolic/mupad_tutorial.pdf .
To open a new MuPAD notebook from the MATLAB command line, enter
nb = mupad
(You can use any variable name you like instead of nb.) This opens a blank MuPAD notebook.
The variable nb is a handle to the notebook. This handle is used only for communication between the MATLAB workspace and the MuPAD notebook. It can be used as described in Copying Variables and Expressions Between the MATLAB Workspace and MuPAD Notebooks.
You can also open an existing MuPAD notebook file named file_name from the MATLAB command line by entering the command
nb2 = mupad('file_name')This command is useful in case you lose the handle to a notebook; save the notebook file, and reopen it with a fresh handle.
Warning You can lose data when saving a MuPAD notebook. A notebook saves its inputs and outputs, but not the state of its engine. In particular, variables copied into a notebook using setVar(nb,...) are not saved with the notebook. |
You can open and save MuPAD notebook files using the usual file system commands, and by using the MATLAB or MuPAD File menu. However, to use a handle to a notebook, you must open the notebook using the mupad command at the MATLAB command line.
Note MuPAD notebook files open in an unevaluated state; in other words, the notebook is not synchronized with its engine when it opens. To synchronize a notebook with its engine, choose Evaluate All from the Notebook menu. For more information, see Synchronizing a Notebook and its Engine. |
If you have no MuPAD interfaces open, the command
mupadwelcome
brings up a window for launching various MuPAD interfaces.

To access MuPAD Help, click one of the three options in the First Steps pane.
To launch a file in the Open recent File list, single-click its name.
To launch a new notebook, click the New Notebook button.
To launch a program editor, click the New Editor button. For information on this interface and its associated debugger, see MuPAD Help.
To open an existing MuPAD notebook or program file, click Open File and navigate to the file.
Alternatively, you can launch the mupadwelcome screen from the MATLAB Start menu as pictured.

A MuPAD notebook has the following main components.

Enter commands for execution, evaluation, or plotting in input areas.
Enter commentary in text areas.
Use the Command Bar to help you enter commands into input areas with the proper syntax.
Use the Insert menu to add a text area (called Text Paragraph) or input area (called Calculation).
Use the Notebook menu to evaluate expressions in input areas.
The MuPAD notebook interface differs from the MATLAB interface. Here are some things to keep in mind when working in a MuPAD notebook:
Commands typed in an input area are not evaluated until you press Enter.
You can edit the commands typed in any input area. For example, you can change a command, correct syntax, or try different values of parameters simply by selecting the area you wish to change and typing over it. Press Enter to have the notebook evaluate the result.
Results do not automatically cascade or propagate through a notebook, as described in Cascading Calculations.
The MATLAB method of recalling a previous command by typing an up arrow key does not have the same effect in a MuPAD notebook. Instead, you use arrow keys for navigation in MuPAD notebooks, similar to most word processors.
If you change a variable in a notebook, the changes do not automatically propagate throughout the notebook. For example, consider the following set of MuPAD commands.

Now change the definition of z in the first line of the notebook from sin(x) to cos(x) and press Enter.

Only the first line was reevaluated. Therefore y and z are no longer synchronized; the notebook is in an inconsistent state.
To have the changes cascade to all parts of the notebook, select Notebook > Evaluate All.

The engine evaluates all the expressions in the notebook from top to bottom, and the notebook becomes consistent.

When you open a saved MuPAD notebook file, the notebook display is not synchronized with its engine. For example, suppose you saved the notebook pictured in the start of Cascading Calculations:

If you open that file and immediately try to work in it, without synchronizing the notebook with its engine, the expressions in the notebook display are unavailable for calculations. For example, try to calculate u := (1+w)/w:

The variable w has no definition as far as the engine is concerned.
To remedy this situation, select Notebook > Evaluate All. The variable u changes to reflect the value of w.

There are several differences between MATLAB and MuPAD syntax. Be aware of which interface you are using in order to use the correct syntax:
Use MATLAB syntax in the MATLAB workspace, except for the functions evalin(symengine,...) and feval(symengine,...), which use MuPAD syntax.
Use MuPAD syntax in MuPAD notebooks.
You must define MATLAB variables before using them. However, every expression entered in a MuPAD notebook is assumed to be a combination of symbolic variables unless otherwise defined. This means that you have to be especially careful when working in MuPAD notebooks, since fewer of your typographic errors cause syntax errors.
This table lists common tasks, meaning commands or functions, and how they differ in MATLAB and MuPAD syntax.
Common Tasks in MATLAB and MuPAD Syntax
| Task | MATLAB syntax | MuPAD syntax |
|---|---|---|
| Assignment | = | := |
| List variables | whos | anames(All, User) |
| Numerical value of expression | double(expression) | float(expression) |
| Suppress output | ; | : |
| Enter matrix | [x11,x12,x13; x21,x22,x23] | matrix([[x11,x12,x13], [x21,x22,x23]]) |
| {a,b,c} | cell array | set |
| Linear algebra commands | Nothing extra needed | linalg:: prefix, or use(linalg) |
| Autocompletion | Tab | Ctrl-space |
| Equality, inequality comparison | ==, ~= | =, <> |
The next table lists the differences between MATLAB expressions and MuPAD expressions.
MATLAB vs. MuPAD Expressions
| MATLAB Expression | MuPAD Expression |
|---|---|
| Inf | infinity |
| pi | PI |
| i | I |
| NaN | undefined |
| fix | trunc |
| log | ln |
| asin | arcsin |
| acos | arccos |
| atan | arctan |
| asinh | arcsinh |
| acosh | arccosh |
| atanh | arctanh |
| acsc | arccsc |
| asec | arcsec |
| acot | arccot |
| acsch | arccsch |
| asech | arcsech |
| acoth | arccoth |
| besselj | besselJ |
| bessely | besselY |
| besseli | besselI |
| besselk | besselK |
| lambertw | lambertW |
| sinint | Si |
| cosint | Ci |
| eulergamma | EULER |
| conj | conjugate |
| catalan | CATALAN |
| laplace | transform::laplace |
| ilaplace | transform::invlaplace |
| ztrans | transform::ztrans |
| iztrans | transform::invztrans |
The MuPAD definition of Fourier transform and inverse Fourier transform differ from their Symbolic Math Toolbox counterparts by the sign of the exponent:
| Symbolic Math Toolbox definition | MuPAD definition | |
|---|---|---|
| Fourier transform |
F = fourier(f) |
F = transform::fourier(f,x,w) |
| Inverse Fourier transform |
Finv = ifourier(f) |
Finv = transform::invfourier(f,w,x) |
The MuPAD definition of exponential integral differs from the Symbolic Math Toolbox counterpart:
| Symbolic Math Toolbox definition | MuPAD definition | |
|---|---|---|
| Exponential integral | expint(x) = –Ei(–x)
= |
The definitions of Ei extend to the complex plane, with a branch cut along the negative real axis. |
![]() | Understanding MuPAD | Integration of MuPAD and MATLAB | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |