Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

## Properties

Three types of mathematical properties are available in MuPAD®:

• Basic number domains, such as the domain of integers, the domain of rational numbers, the domain of real numbers, the domain of positive real numbers, or the domain of complex numbers

• Intervals in basic number domains

• Residue classes of integers

Often, there are several equivalent ways to specify a property. For example, >= 0, Type::NonNegative, and Type::Interval([0], infinity) are equivalent properties. Similarly, Type::Odd is equivalent to Type::Residue(1, 2).

Some members of the Type library do not correspond to mathematical properties, for example, Type::ListOf.

This table shows some examples of how to set properties on the identifier or expression expr.

 Note:   If expr is a list, vector, or matrix, then only the syntax (expr, set) is valid. Do not use the syntaxes (expr in set) or relations, such as expr > 0 or expr < 0, for nonscalar expr.
PropertyRecommended Way to Specify a Property of exprAlternative Way to Specify a Property of expr

Real value,

(expr, R_)

(expr,Type::Real)

Imaginary value,

(expr, R_*I) or (expr in R_*I)

(expr,Type::Imaginary)

Complex value, . This is a default value for most MuPAD objects.

(expr, C_) or (expr in C_)

(expr, Type::Complex)

Integer value,

(expr, Z_) or (expr in Z_)

(expr,Type::Integer)

Rational value,

(expr, Q_)

(expr,Type::Rational)

Positive value,

(expr > 0)

(expr,Type::Positive)

Negative value,

(expr < 0)

(expr,Type::Negative)

Nonnegative value,

(expr >= 0)

(expr,Type::NonNegative)

Zero, {0}

(expr = 0)

(expr,Type::Zero)

Nonzero value,

(expr <> 0)

(expr,Type::NonZero)

Even value,

(expr, 2*Z_) or (expr in 2*Z_)

(expr,Type::Even)

Odd value,

(expr, 2*Z_ + 1)

(expr,Type::Odd)

Positive integer value,

(expr in Z_ and expr > 0)

(expr,Type::PosInt)

Negative integer value,

(expr in Z_ and expr < 0)

(expr,Type::NegInt)

Nonnegative integer value,

(expr in Z_ and expr >= 0)

(expr,Type::NonNegInt)

Positive rational value,

(expr in Q_ and expr > 0)

(expr,Type::PosRat)

Negative rational value,

(expr in Q_ and expr < 0)

(expr,Type::NegRat)

Nonnegative rational value,

(expr in Q_ and expr >= 0)

(expr,Type::NonNegRat)

Here, a,b are expressions, and T is a basic number domain.

(expr in T and a < expr < b)

(expr, Type::Interval(a, b, T))

Here, a,b are expressions, and T is a basic number domain.

(expr in T and a <= expr < b)

(expr, Type::Interval([a], b, T))

Here, a,b are expressions, and T is a basic number domain.

(expr in T and a < expr <= b)

(expr, Type::Interval(a, [b], T))

Here, a,b are expressions, and T is a basic number domain.

(expr in T and a <= expr <= b)

(expr, Type::Interval([a], [b], T))

b + a

Here, a and b are integers.

(expr, b*Z_ + a) or (expr in b*Z_ + a)

(expr, Type::Residue(a, b)) or (expr, b* Type::Integer + a)