Indeterminates of an 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.
indets(object
) indets(object
, <All>) indets(object
, <PolyExpr>) indets(object
, <RatExpr>)
indets(object)
returns the indeterminates
contained in object
.
indets(object)
returns the indeterminates
of object
as a set,
i.e., the identifiers without a value
that occur in object
, with the exception of those
identifiers occurring in the 0
th operand of a subexpression
of object
(see Example 1).
indets
regards the special identifiers PI
, EULER
, CATALAN
as
indeterminates, although they represent constant real numbers. If
you want to exclude these special identifiers, use indets(object)
minus Type::ConstantIdents
(see example Example 1).
If object
is a polynomial,
a function environment, a procedure, or a builtin
kernelfunction, then indets
returns
the empty set. See Example 2.
Consider the following expression:
delete g, h, u, v, x, y, z: e := 1/(x[u] + g^h)  f(1/3) + (sin(y) + 1)^2*PI^3 + z^(3)*v^(1/2)
indets(e)
Note that the returned set contains x
and u
and
not, as one might expect, x[u]
, since internally x[u]
is
converted into the functional form _index(x, u)
.
Moreover, the identifier f
is not considered an
indeterminate, since it is the 0
th operand of the
subexpression f(1/3)
.
Although PI
mathematically represents a constant,
it is considered an indeterminate by indets
. Use Type::ConstantIdents
to
circumvent this:
indets(e) minus Type::ConstantIdents
The result of indets
is substantially different
if one of the two options RatExpr
or PolyExpr
is
specified:
indets(e, RatExpr)
Indeed, e
is a rational expression in the
"indeterminates" z, PI, sin(y), g^h, x[u],
v^(1/2)
: e
is built from these atoms
and the constant expression f(1/3)
by using only
the rational operations +
, 
, *
, /
,
and ^
with integer exponents. Similarly, e
is
built from PI,sin(y),z^(3),1/(g^h+x[u]),v^(1/2)
and
the constant expression f(1/3)
using only the polynomial
operations +
, 
, *
,
and ^
with nonnegative integer exponents:
indets(e, PolyExpr)
indets
also works for various other data
types. Polynomials and functions are considered to have no indeterminates:
delete x, y: indets(poly(x*y, [x, y])), indets(sin), indets(x > x^2+1)
For container objects, indets
returns the
union of the indeterminates of all entries:
indets([x, exp(y)]), indets([x, exp(y)], PolyExpr)
For tables, only the indeterminates of the entries are returned; indeterminates in the indices are ignored:
indets(table(x = 1 + sin(y), 2 = PI))
In the previous examples we saw that the 0
th
operand of a subexpression is not used for finding indeterminates.
With the option All
this is changed:
delete x: e := sin(x): indets(e, All)
A more complex example:
delete g, h, u, v, y, z: e := 1/(x[u] + g^h)  f(1/3) + (sin(y) + 1)^2*PI^3 + z^(3)*v^(1/2)
indets(e,All)
delete e:

An arbitrary object 

Identifiers occurring in the With this option, the 

Return a set of arithmetical expressions such
that With this option, If 

Return a set of arithmetical expressions such
that With this option, 
object
If object
is an element of a library domainT
that
has a slot "indets"
, then the slot routine T::indets
is
called with object
as argument. This can be used
to extend the functionality of indets
to userdefined
domains. If no such slot exists, then indets
returns
the empty set.
collect
 domtype
 op
 poly
 rationalize
 type
 Type::Indeterminate
 Type::PolyExpr
 Type::RatExpr