Type::RatExpr

Type representing rational expressions

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

testtype(obj, Type::RatExpr(indet, <coeff_type>))

Description

With Type::RatExpr, rational expressions can be identified.

The call testtype(obj, Type::RatExpr(indet)) checks, whether obj is a rational expression in the indeterminante indet, i.e., the quotient of two polynomial expressions in indet. If it is, the result is TRUE, otherwise FALSE.

A rational expression in indet is a expression, and indet occurs only as operand of _plus or _mult expressions and in _power with an integer exponent.

indet must be an identifier, and coeff_type a type for the coefficients of the rational expression.

This type does not represent a property.

Examples

Example 1

A polynomial expression in x is also a rational expression in x:

testtype(-x^2 - x + 3, Type::RatExpr(x))

testtype is used to select all rational operands in x with positive integer coefficients:

EX := sin(x) + x^2 - 3*x + 2 + 3/x:
select(EX, testtype, Type::RatExpr(x, Type::PosInt))

delete EX:

Parameters

obj

Any MuPAD® object

indet

An indeterminante

coeff_type

A type for the coefficientes; 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

Was this topic helpful?