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::Function

Type representing functions

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::Function)

Description

Type::Function represents all MuPAD® functions (procedures, executable objects etc).

The call testtype(obj, Type::Function) checks, whether obj is an executable MuPAD object. The call returns TRUE or FALSE, respectively.

"Executable objects" in MuPAD are procedures (of type DOM_PROC), function environments (of type DOM_FUNC_ENV), and pure kernel functions (of type DOM_EXEC).

Additionally, symbolic function iteratesf@@n (representing the map x -> f(..(f(x))..)) and symbolic function compositionsf@g (representing the function x -> f(g(x)) are regarded as executable objects.

This type does not represent a property.

Examples

Example 1

Type::Function accepts procedures:

testtype(proc(x) begin x^2 end, Type::Function)

Type::Function accepts simple procedures generated with the "arrow operator" ->, too:

testtype(x -> x^2, Type::Function)

sin is a function environment, accepted by Type::Function:

testtype(sin, Type::Function)

The first operand of the function environment print is a pure kernel function, accepted by Type::Function:

testtype(op(print, 1), Type::Function)

The 3-fold iterate of the function diff is accepted by Type::Function:

testtype(diff@@3, Type::Function)

The composition of functions is accepted by Type::Function:

testtype(f@g, Type::Function)

Any other MuPAD object is determined as non executable object by Type::Function:

map([1, TRUE, x, {}], testtype, Type::Function)

Parameters

obj

Any MuPAD object

Return Values

See testtype

See Also

MuPAD Functions

Was this topic helpful?