Control evaluation and level of evaluation, prevent infinite recursions


MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

To convert a MuPAD notebook file to a MATLAB live script file, see convertMuPADNotebook. MATLAB live scripts support most MuPAD functionality, although there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

MuPAD Functions

blockCreate an object protected against evaluation
blockIdentsCreate a block with some identifiers protected against evaluation
blockTransparentCreate a transparent block protected against evaluation
unblockReplace blocks by their contents
contextEvaluate an object in the enclosing context
evalEvaluate an object
evalassignAssignment with evaluation of the left hand side
evalAtInsert a value (evaluate at a point)
evalpEvaluate a polynomial at a point
freezeCreate an inactive copy of a function
unfreezeCreate an active copy of a frozen function
holdDelay evaluation
LEVELSubstitution depth of identifiers
levelEvaluate an object with a specified substitution depth
MAXDEPTHPrevent infinite recursion during procedure calls
MAXEFFORTMaximum amount of work to spend on the computation
MAXLEVELPrevent infinite recursion during evaluation

Examples and How To

Enforce Evaluation

MuPAD automatically evaluates results returned by most of the system functions.

Prevent Evaluation

When you perform interactive computations in MuPAD, the system tries to evaluate all expressions before returning them.

Evaluate at a Point

To evaluate an expression for particular values of identifiers, use the evalAt function or its shortcut |.


Evaluations in Symbolic Computations

Evaluation is one of the most common mathematical operations.

Level of Evaluation

The value of an identifier can contain arbitrary MuPAD objects, including identifiers.

Actual and Displayed Results of Evaluations

When MuPAD evaluates an expression or executes a command, the output that the system displays can differ from the actual result.