Documentation Center

  • Trial Software
  • Product Updates


Type representing functions

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.


testtype(obj, Type::Function)


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.


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)



Any MuPAD object

Return Values

See testtype

See Also

MuPAD Functions

Was this topic helpful?