f = [cos, -sin; sin, cos];defines a function
>> f = [cos, -sin; sin, cos]; >> f(pi/4) 0.707 -0.707 0.707 0.707Note that the elements of the matrix can be data of other type that can be used as functions, and are not restricted to functions (user or built-in). As long as one element is a function, the whole matrix is evaluated to a function matrix. The following example creates a function matrix
f = [exp <> cos, 2; x -> sqrt(1 + x^2), exp <> (-sin)]which represents the following function
In general, all the elements of a matrix function should have the same number of input arguments, and the return values should be compatible for building a matrix.