Documentation

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:

• Use MATLAB syntax in the MATLAB workspace, except for the functions `evalin(symengine,...)` and `feval(symengine,...)`, which use MuPAD 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 must be especially careful when working in MuPAD notebooks, since fewer of your typos cause syntax errors.

This table lists common tasks, meaning commands or functions, and how they differ in MATLAB and 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 arrayset
Auto-completionTabCtrl+space bar
Equality, inequality comparison`==`, `~=``=`, `<>`

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

`Inf``infinity`
`pi``PI`
`i``I`
`NaN``undefined`
`fix``trunc`
`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`

The MuPAD definition of exponential integral differs from the Symbolic Math Toolbox™ counterpart.

Exponential integral

expint(x) = –Ei(–x) =

Ei(1, x).

$\text{Ei}\left(n,x\right)=\underset{1}{\overset{\infty }{\int }}\frac{\mathrm{exp}\left(-xt\right)}{{t}^{n}}\text{ }dt.$

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