Syntaxr = maple('statement')
r = maple('function',arg1,arg2,...)
[r, status] = maple(...)
maple('traceon') or maple trace on
maple('traceoff') or maple trace off
Descriptionmaple('statement') sends statement to the Maple kernel and returns the result. A semicolon for the Maple syntax is appended to statement if necessary. maple('function',arg1,arg2,...) accepts the quoted name of any Maple function and associated input arguments. The arguments are converted to symbolic expressions if necessary, and function is then called with the given arguments. If the input arguments are syms, then maple returns a sym. Otherwise, it returns a result of class char. [r,status] = maple(...) is an option that returns the warning/error status. When the statement execution is successful, r is the result and status is 0. If the execution fails, r is the corresponding warning/error message, and status is a positive integer. maple('traceon') (or maple trace on) causes all subsequent Maple statements and results to be printed. maple('traceoff') (or maple trace off) turns this feature off. ExamplesEach of the following statements evaluate to 100 digits. maple('evalf(Pi,100)')
maple evalf Pi 100
maple('evalf','Pi',100)
The statement [result,status] = maple('BesselK',4.3)
returns the following output because Maple's BesselK function needs two input arguments. result =
Error, (in BesselK) expecting 2 arguments, got 1
status =
2
The traceon command shows how Symbolic Math Toolbox commands interact with Maple. For example, the statements syms x
v = [x^2-1;x^2-4]
maple traceon % or maple trace on
w = factor(v)
return v =
[ x^2-1]
[ x^2-4]
statement:
map(ifactor,array([[x^2-1],[x^2-4]]));
result:
Error, (in ifactor) invalid arguments
statement:
map(factor,array([[x^2-1],[x^2-4]]));
result:
matrix([[(x-1)*(x+1)], [(x-2)*(x+2)]])
w =
[ (x-1)*(x+1)]
[ (x-2)*(x+2)] |