This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Type and property representing complex numbers

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.


testtype(obj, Type::Complex)
assume(x, Type::Complex)
is(ex, Type::Complex)


Type::Complex represents complex numbers. This type can also be used as a property to mark identifiers as complex numbers.

The call testtype(obj, Type::Complex) checks, whether obj is a complex number and returns TRUE, if it holds, otherwise FALSE.

testtype only performs a syntactical test identifying MuPAD® objects of type DOM_INT, DOM_RAT, DOM_FLOAT and DOM_COMPLEX. This does not include arithmetical expressions such as exp(1), which are not identified as of type Type::Complex.

The call assume(x, Type::Complex) marks the identifier x as a complex number.

The call is(ex, Type::Complex) derives, whether the expression ex is a complex number (or this property can be derived).

This type represents a property that can be used in assume and is.


Example 1

The following numbers are of type Type::Complex:

testtype(2, Type::Complex),
testtype(3/4, Type::Complex),
testtype(0.123, Type::Complex),
testtype(1 + I/3, Type::Complex),
testtype(1.0 + 2.0*I, Type::Complex)

The following expressions are exact representations of complex numbers. Syntactically, however, they are not of type Type::Complex:

testtype(exp(3), Type::Complex),
testtype(PI^2 + 5, Type::Complex),
testtype(sin(2) + PI*I, Type::Complex)

Example 2

Identifiers may be assumed to represent a complex number:

assume(x, Type::Complex): is(x, Type::Complex)

The real numbers are a subset of the complex numbers:

assume(x, Type::Real): is(x, Type::Complex)

Without further information, it cannot be decided whether a complex number is real:

assume(x, Type::Complex): is(x, Type::Real)




Any MuPAD object


An identifier


An arithmetical expression

Return Values

See assume, is and testtype

See Also

MuPAD Functions

Was this topic helpful?