Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

Differences Between MATLAB and MuPAD Syntax

    Note:   MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

    MATLAB live scripts support most MuPAD functionality, though there are some. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

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 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.

Common Tasks in MATLAB and MuPAD Syntax

TaskMuPAD SyntaxMATLAB Syntax
Assignment:==
List variablesanames(All, User)whos
Numerical value of expressionfloat(expression)double(expression)
Suppress output:;
Enter matrixmatrix([[x11,x12,x13], [x21,x22,x23]])[x11,x12,x13; x21,x22,x23]
Translate MuPAD set{a,b,c}unique([1 2 3])
Auto-completionCtrl+space barTab
Equality, inequality comparison=, <>==, ~=

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

MATLAB vs. MuPAD Expressions

MuPAD ExpressionMATLAB Expression
infinityInf
PIpi
Ii
undefinedNaN
truncfix
arcsinasin
arccosacos
arctanatan
arcsinhasinh
arccoshacosh
arctanhatanh
arccscacsc
arcsecasec
arccotacot
arccschacsch
arcsechasech
arccothacoth
besselJbesselj
besselYbessely
besselIbesseli
besselKbesselk
lambertWlambertw
Sisinint
Cicosint
EULEReulergamma
conjugateconj
CATALANcatalan

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

 Symbolic Math Toolbox DefinitionMuPAD Definition
Exponential integral

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

xexp(t)tdt for x>0=

Ei(1, x).

Ei(x)=xettdt for x<0.

Ei(n,x)=1exp(xt)tndt.

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

Was this topic helpful?