Type::PolyExpr

Type representing polynomial 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.

Syntax

testtype(obj, Type::PolyExpr(unknowns, <coeff_type>))

Description

With Type::PolyExpr, polynomial expressions can be identified.

The call testtype(obj, Type::PolyExpr(unknowns)) checks, whether obj is a polynomial expression in the indeterminates unknowns and, if so, returns TRUE, otherwise FALSE.

A polynomial expression in indet is an expression, where indet occurs only as operand of _plus or _mult expressions and in the base of _power with a positive integer exponent.

A polynomial expression is a representation of a polynomial, but it has the MuPAD® type DOM_EXPR and is not produced by the function poly.

indets must be an identifier or a list of identifiers.

The optional argument coeff_type determines the type of the coefficients. If it is not given, Type::AnyType will be used.

This type does not represent a property.

Examples

Example 1

Is the object a polynomial expression with variable x?

X := -x^2 - x + 3:
testtype(X, Type::PolyExpr(x))

But X is not a MuPAD polynomial in x:

testtype(X, Type::PolyOf(x))

Is the object a polynomial expression with variables x and y and with integer coefficients?

X := -x^2 - x + 3:
testtype(X, Type::PolyExpr([x, y], Type::Integer))

The next example too?

X := -x^2 - y^2 + 3*x + 3*y - 1:
testtype(X, Type::PolyExpr([x, y], Type::Integer))

delete X:

Parameters

obj

Any MuPAD object

unknowns

An indeterminate or a list of indeterminates

coeff_type

The type of the coefficients; a type can be an object of the library Type or one of the possible return values of domtype and type

Return Values

See testtype

See Also

MuPAD Functions