Abbreviates a expression
MuPAD® notebooks are not recommended. 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.
output::subexpr rewrites symbolic expression
in terms of common subexpressions.
If an expression
e contains common subexpressions,
a list that contains the abbreviated expression and the abbreviations
in a form of equations. With
get the same abbreviations as you see in the outputs. See Example 1.
An output of this command does not depend on the current setting
By default, MuPAD® generates abbreviations using the # symbol
followed by numbers. Using the argument
you can customize the names of abbreviated subexpressions. See Example 2.
You can abbreviate an expression:
y := solve(x^3 + x + 1 = 0, x, MaxDegree = 3): output::subexpr(y)
You can customize the names of abbreviated subexpressions:
y := solve(x^3 + x + 1 = 0, x, MaxDegree = 3): output::subexpr(y, t)
A MuPAD expression
A base name for the abbreviation variables
List that contains the abbreviated expression and the abbreviations as equations