Type of “general expressions”
MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
DOM_EXPR is the data type of symbolic function
calls. This includes expressions such as a + b which
is internally stored as
In MuPAD®, non-atomic symbolic expressions which are not
elements of special domains have type
Objects of type
DOM_EXPR have a 0th
operand which contains the functor (the function symbol, the f in f(x)).
This operand is not counted in the result of
nops. The subsequent operands can be
of arbitrary type (although most functions will limit the number and
type of operands when evaluated).
The 0th operand of
DOM_EXPR will be a procedure or function environment
only in exceptional circumstances. In usual circumstances, expressions
only have expressions, domain elements, or identifiers as their 0th
Function calls are of type
The 0th operand of a function call is the function symbol:
The effect of using an expression of type
a function to call depends on the 0th
operand of the expression. For many system functions, the result is
that of using all operands of the expression as functions, passing
the unevaluated arguments. (These functions may
in turn evaluate their arguments.)
Most MuPAD functions (documented as accepting “arithmetical
expressions”) are built to work on elements of type
Often, the operands of an expression will be expressions themselves.
This creates a so-called “expression tree” which can
be visualized using
All expressions are internally represented as function calls. The 0th operand is the function symbol of this call.
Evaluating an expression results in calling the 0th
operand as a function. For library functions without
option hold, the operands
are evaluated first.