Symbolic Math Toolbox | Search  Help Desk | |
subexpr | Examples | See Also |
Rewrite a symbolic expression in terms of common subexpressions.
[Y,SIGMA] = subexpr(X,SIGMA) [Y,SIGMA] = subexpr(X,'SIGMA')
[Y,SIGMA] = subexpr(X,SIGMA)
or [Y,SIGMA] = subexpr(X,'SIGMA')
rewrites the symbolic expression X
in terms of its common subexpressions. These are the subexpressions that are written as %1
, %2
, etc. by pretty(S)
.
The statements
t = solve('a*x^3+b*x^2+c*x+d = 0'); [r,s] = subexpr(t,'s');return the rewritten expression for
t
in r
in terms of a common subexpression, which is returned in s
.
pretty
, simple
, subs