Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Type::Product

Type representing sequences

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.

Syntax

testtype(obj, Type::Product(typedef, …))

Description

Type::Product is the type of sequences of objects of different types.

The call testtype(obj, Type::Product( typedef , …)) checks, whether obj is a sequence of objects, which have the types given by typedef and returns TRUE, if it holds, otherwise FALSE.

obj must have the same number of arguments as the sequence typedef. The elements of obj are checked one after another: the first element of obj is checked against the type given by the first element of typedef and so on. All elements and types must match.

typedef, … must be a nonempty sequence of types. A type can be an object of the library Type or one of the possible return values of domtype and type.

This type does not represent a property.

Examples

Example 1

The argument is a sequence of a positive integer followed by an identifier:

testtype((5, x), Type::Product(Type::PosInt, Type::Unknown))

Is the argument is a sequence of five positive integers?

testtype((5, 3, 5, -1, 0), Type::Product(Type::PosInt $ 5))

Parameters

obj

Any MuPAD® object

typedef

A sequence of types; 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?