| 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… |
|---|
Choosing a Maple or MuPAD Engine Differences in Maple and MuPAD Syntax Differences in Functionality When Using MuPAD and Maple Engines |
You can use a Maple engine with Symbolic Math Toolbox software instead of the default MuPAD engine. You must have a compatible version of Maple software, available from Maplesoft®, installed on your computer. Contact http://www.maplesoft.com/ to find which versions of Maple software work with Symbolic Math Toolbox software.
To choose a Maple engine:
Enter
symengine
at the MATLAB command line to display the following GUI.

• To use a Maple engine, click the Maple button, then the Maple Location button, and navigate to your computer's Maple installation directory.
To determine this directory:
Launch or switch to Maple.
Enter the command
kernelopts(mapledir);
at the Maple prompt.
• To use a MuPAD engine, click the MuPAD button.
Clear all symbolic variables if you change engines while using Symbolic Math Toolbox software. Do this by entering the clear command, or syms variable–list.
Caution Results may differ when computed with a Maple engine compared to those computed with a MuPAD engine. Also, the capabilities of the engines may differ. |
Prior to Version 5 of Symbolic Math Toolbox, Extended Symbolic Math Toolbox™ software supported calling the Maple engine from the MATLAB workspace with the maple and procread functions. Symbolic Math Toolbox software now uses the MuPAD engine by default, and uses the evalin(symengine,...) and feval(symengine,...) functions to access the MuPAD engine from the MATLAB workspace.
Caution Be sure to select the functions and syntax that are appropriate for your selected symbolic engine. For example, use procread and maple with a Maple engine; use evalin and feval with a MuPAD engine. The tables in the remainder of this section show the differences in syntax between the two engines. |
The maple function is equivalent to one of three MuPAD calls, depending on its syntax:
| Maple Engine Syntax | MuPAD Engine Syntax |
|---|---|
| maple(command) | evalin(symengine,'command') |
| maple('function',arg1,arg2,...) | feval(symengine, 'function', arg1, arg2,...) |
| maple restart | reset(symengine) |
The content of the command and function names must be in the correct syntax, as well as the MATLAB function call. The tables in Maple and MuPAD Syntax, Maple and MuPAD Library Calls, and Maple and MuPAD Constants describe the differences between Maple and MuPAD syntax.
The feval and evalin functions return symbolic expressions, while the maple command returns strings or symbolic expressions, depending on the types of the inputs.
To convert a symbolic expressions to a string, call the char method. For example, if x is a symbolic variable equal to z^2/cos(z), then
y = char(x)
sets y to the string 'z^2/cos(z)'.
The procread function, used with a Maple engine, is equivalent to an appropriate evalin(symengine,...) method for a MuPAD engine. The evalin call should contain a command to read the code, as shown in the table below.
The following table contains an example in both Maple and MuPAD syntax.
| Example of procread and evalin Calls | |
|---|---|
| procread for Maple Engine | evalin for MuPAD Engine |
procread('check.src')The check.src file contains the following code in Maple syntax: check := proc(A)
# check(A) computes A*inverse(A)
local X;
X := inverse(A):
evalm(A &* X);
end; | evalin(symengine,'read("check.mu")')Note that the " in the evalin call are double-quote characters, not two single-quote characters. The check.mu file contains the following code in MuPAD syntax: check := proc(A)
// check(A) computes A*inverse(A)
local X;
begin
X := 1/A;
A * X;
end_proc: |
The Maple engine mhelp function displays help about Maple functions to the command line. The equivalent MuPAD function is the doc method of the object returned by symengine. The doc method opens MuPAD Help to the specified function. This table shows the differences in syntax.
| Maple Syntax | MuPAD Syntax |
|---|---|
| mhelp int | doc(symengine,'int') |
| mhelp convert | doc(symengine,'rewrite') |
The table uses the equivalence of the Maple function convert and the MuPAD function rewrite. To find the differing syntax between the two engines, see Maple and MuPAD Syntax and Maple and MuPAD Library Calls.
The following table lists common tasks (meaning functions or procedures) that have differences between Maple and MuPAD syntax. Blank entries in the table mean the task is not explicitly supported. Optional arguments are enclosed in angle brackets < >.
| Task | Maple Syntax | MuPAD Syntax |
|---|---|---|
| Comment | #comment | // one-line comment /* multi-line comment */ |
| Previous results | %, %%, %%% | %, %1, %2 |
| Timing | s:=time(); cmd1;...;cmdN; time()-s | time(), time(cmd1,...,cmdN) |
| Matrices | <1,2;3,4> | matrix([[1,2],[3,4]]) |
| Appending | [op(x), a, b, ...] | append(x, a, b, ...) |
| Concatenating lists | [op(x),op(y)] | x.y, [op(x),op(y)] |
| Sequences | i^2$i=1..5 or seq(i^2,i=1..5) | i^2$i=1..5 |
| seq(f, i = m..n, e) | f(i) $ i = m..n step e | |
| Types | whattype(expr) | type(expr), domtype(expr) |
| Testing types | type(expr,type) | testtype(expr,type) |
| Operand queries | op(n,expr), n >= 0 | op(expr,n), n >= 0 |
| Clearing variables | x := 'x' | delete x |
| Namespaces | x[y], :- | x::y |
| Employing package | with | use |
| String/name concatenation | x || 10 | x . 10 |
| For loops | for i from 6 by 2 to 100 do body end do; | for i from 6 to 100 step 2 do body end_for |
| for x in obj do body; end do | for x in obj do body; end_for | |
| While loops | while i < 100 do i := i+10; end do | while i < 100 do i := i+10; end_while |
| Repeat | repeat body until cond end_repeat | |
| If/then/else | if b then x end if | if b then x end_if |
| Trapping errors | traperror(stmt) | traperror(stmt, <T>, <MaxSteps>) |
| Try/catch | try stmt; catch string:stmt; finally stmt end | |
| Procedure definition | f:=proc(x) local n; body; end; | f:=proc(x) local n; begin body; end_proc; |
| Non-commuting multiplication | &* (& is neutral-op) or A . B | domain overload of * |
The following table lists tasks that require different library function calls in Maple syntax and MuPAD syntax. Blank entries in the table mean the call is not explicitly supported. Optional arguments are enclosed in angle brackets < >.
| Task | Maple Syntax | MuPAD Syntax | |
|---|---|---|---|
| Reading data | read(filename) | read(filename, <Quiet>, <Plain>) | |
| Opening files | open(name,mode) | fopen(filename | TempFile,<Read | Write | Append>, <Bin | Text | Raw>) | |
| Displaying results | print(e1, e2, ... ) | print(<Unquoted>, <NoNL>, <KeepOrder>, <Typeset>, object1, object2, ...) | |
| Substituting | subs(x=a,f) | subs(f, x=a, <unsimplified>) | |
| Limits | limit(f, x=a, <left | right | real | complex>) | limit(f, x=a, <Left | Right | Real>, <Intervals>) | |
| Mapping | map(f, expr, arg1, arg2, ...) | map(expr, f, <arg1, arg2, ...>, <Unsimplified>) | |
| Logarithms | log(x) | ln(x) | |
| Some special functions | AiryAi(n,z) | airyAi(z,n) | |
| argument(z) | arg(z) | ||
| dirac(n,x), dirac([n1..nk],[x1..xk]) | dirac(x,n) | ||
| EllipticK(z) different norm | EllipticK(z) | ||
| EllipticPi(z,nu,k) different norm | EllipticPi(m,phi,n) | ||
| FresnelC(x) different norm | fresnelC(x) | ||
| GAMMA(x) | gamma(x) | ||
| GAMMA(a,x) | igamma(a,x) | ||
| lnGAMMA(x) | lngamma(x) | ||
| Heaviside(t) | heaviside(x) | ||
| JacobiAM(z,k) different norm | jacobiAM(u,m) | ||
| Tensor[KroneckerDelta](m,n) | kroneckerDelta(m,n) | ||
| Psi(n,x) | psi(x,n) | ||
| Wrightomega(x) | wrightOmega(x) | ||
| Factorials | n! or factorial(n) | n! or fact(n) | |
| Integrals | int(f, x = a..b) | int(f, x = a..b, <PrincipalValue>) | |
| Taylor series | taylor(f, x=a, n) | taylor(f, x = x0, <order>, <mode>, <NoWarning>) | |
| Coefficients | coeffs(p, x, 't'), coeff(p, x, n) | coeffs(f, <vars>, <x>, n) | |
| Simplifying basic | simplify(f) | Simplify(f, <Steps>), simplify(f) | |
| Simplifying to a target | simplify(f, <symbolic>, <assume=prop>, n1, n2, ...) | simplify(f,target), target = cos, sin, exp, ln, sqrt, unit, logic, condition, or relation | |
| Simplifying special | simplify[radical] | radsimp | |
| Combining | combine(f, n, opt1, opt2, ...) | combine(f, <[target1, target2, ...]>) | |
| Rewriting | convert(expr, form) | rewrite(expr, func) | |
| Collecting | collect(f, x, <form>, <func>) | collect(f, x, <f>) | |
| Factoring | factor(a, K) | factor(f, <Adjoin = adjoin>, <MaxDegree = n>) | |
| Finding free variables (indeterminates) | indets(expr, <typename>) | freeIndets(expr) | |
| Solving equations | solve(equations, variables) | solve(system, vars, <options>) | |
| Solving ODEs | dsolve({ODE, ICs}, y(x), options) | solve(ODE) | |
| Solving recurrences | rsolve(eqns,fcns) | solve(REC) | |
| Finding discontinuities | discont(f,x) | discont(f, x = a .. b, <Undefined>) | |
| Making assumptions | assume(x,real) | assume(x,R_) | |
| Listing properties | about(x) | getprop(x) | |
| Evaluating numerically | evalf(expr) | float(expr) | |
| Evaluating Boolean | evalb(expr) | bool(expr) | |
| Evaluating matrix | evalm(a+b), evalm(x.b) | a+b, a*b matrices a,b | |
| Parsing string | parse(string,options) | text2expr(string) | |
| Showing code | print(f) | expose(f) | |
| Leading terms | lcoeff | lcoeff(p), lterm(p) | |
| Partial fractions | convert(expr, parfrac) | partfrac(f) | |
| Plotting 2-D | plot(f,x=x0..x1) | plot(f1,f2,..., x=x0..x1), plotfunc2d(f1,f2,..., x=x0..x1) | |
| Plotting 3-D | plot3d(f, x=a..b, y=c..d) | plotfunc3d(f1,f2,..., x=x0..x1, y=y0..y1) | |
| Pseudo division | Prem(p,q) | pdivide(p,q) | |
| Splitting objects | selectremove | split(obj,f) |
The following table lists the constants and global symbols that differ between Maple syntax and MuPAD syntax.
| Symbol | Maple Syntax | MuPAD Syntax |
|---|---|---|
| Catalan number | Catalan | CATALAN |
| Digits of precision for floats | Digits | DIGITS |
| Euler's gamma constant | gamma | EULER |
| Library locations | libname | LIBPATH, READPATH, PACKAGEPATH |
| Empty sequence | NULL | null() |
| Default number of terms | Order | ORDER |
| π = 3.14159... | Pi | PI |
| Three-state Boolean logic values | True/False/FAIL | TRUE/FALSE/UNKNOWN |
The following Symbolic Math Toolbox functions introduced in the toolbox version 4.9 require that you run a MuPAD engine:
matlabFunction, which converts a symbolic expression to a function handle or a file
emlBlock, which converts a symbolic expression to an Embedded MATLAB Function block
![]() | Integration of MuPAD and MATLAB | Function Reference | ![]() |

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 |