Products & Services Solutions Academia Support User Community Company

Learn more about Symbolic Math Toolbox   

MuPAD for MATLAB Users

Getting Help for MuPAD

There is extensive online help available for MuPAD. You can access the help browser from the MATLAB workspace in a variety of ways:

Launching, Opening, and Saving MuPAD Notebooks

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.

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.

Opening Recent Files and Other MuPAD Interfaces

If you have no MuPAD interfaces open, the command

mupadwelcome

brings up a window for launching various MuPAD interfaces.

Alternatively, you can launch the mupadwelcome screen from the MATLAB Start menu as pictured.

Calculating in a MuPAD Notebook

The Visual Elements of a Notebook

A MuPAD notebook has the following main components.

Working in a Notebook

The MuPAD notebook interface differs from the MATLAB interface. Here are some things to keep in mind when working in a MuPAD notebook:

Cascading Calculations

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.

Synchronizing a Notebook and its Engine

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.

Differences Between MATLAB and MuPAD Syntax

There are several differences between MATLAB and MuPAD syntax. Be aware of which interface you are using in order to use the correct syntax:

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

TaskMATLAB syntaxMuPAD syntax
Assignment=:=
List variableswhosanames(All, User)
Numerical value of expressiondouble(expression)float(expression)
Suppress output;:
Enter matrix[x11,x12,x13; x21,x22,x23]matrix([[x11,x12,x13], [x21,x22,x23]])
{a,b,c}cell arrayset
Linear algebra commandsNothing extra neededlinalg:: prefix, or use(linalg)
AutocompletionTabCtrl-space
Equality, inequality comparison==, ~==, <>

The next table lists the differences between MATLAB expressions and MuPAD expressions.

MATLAB vs. MuPAD Expressions

MATLAB ExpressionMuPAD Expression
Infinfinity
piPI
iI
NaNundefined
fixtrunc
logln
asinarcsin
acosarccos
atanarctan
asinharcsinh
acosharccosh
atanharctanh
acscarccsc
asecarcsec
acotarccot
acscharccsch
asecharcsech
acotharccoth
besseljbesselJ
besselybesselY
besselibesselI
besselkbesselK
lambertwlambertW
sinintSi
cosintCi
eulergammaEULER
conjconjugate
catalanCATALAN
laplacetransform::laplace
ilaplacetransform::invlaplace
ztranstransform::ztrans
iztranstransform::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 definitionMuPAD 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 definitionMuPAD definition
Exponential integralexpint(x) = –Ei(–x) =

Ei(1, x).

The definitions of Ei extend to the complex plane, with a branch cut along the negative real axis.

  


Recommended Products

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