Documentation Center

  • Trial Software
  • Product Updates

Type::SetOf

Type representing sets

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

testtype(obj, (obj_type, <min_nr, <max_nr>>))

Description

Type::SetOf(obj_type) describes sets of elements of type obj_type.

The call testtype(obj, Type::SetOf(obj_type)) checks, whether obj is a set with elements of the given type obj_type. If it is, the function returns TRUE, otherwise FALSE.

A set has the domain type DOM_SET.

The two optional parameters min_nr and max_nr determine the minimum and maximum number of elements in the analysed set. If the numbers are not be given, the number of elements in the set will not be checked. If only the minimum is given, the set must contain at least min_nr elements for the test to succeed.

This type does not represent a property.

Examples

Example 1

Is the given set a set of identifiers?

testtype({a, b, c, d, e, f}, Type::SetOf(DOM_IDENT))

Is the given set a set of at least five real numbers?

testtype({0, 0.5, 1, 1.5, 2, 2.5, 3}, Type::SetOf(Type::Real, 5))

Example 2

testtype is used to select sets with exactly two idetifiers:

S := {{a}, {a, b}, {d, 1}, {0, d}, {e}, {d, e}}:
select(S, testtype, Type::SetOf(DOM_IDENT, 2, 2))

Parameters

obj

Any MuPAD® object

obj_type

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

min_nr

The minimal number of objects as nonnegative integer

max_nr

The maximal number of objects as nonnegative integer

Return Values

See testtype

See Also

MuPAD Domains

MuPAD Functions

Was this topic helpful?