I would like to define a matrix of symbolic functions (not variables) in Matlab. In the workspace I would like it to be an element of class symfun of size N-by-M (where N<
If you for example want to arrange some anonymous symbolic functions in a vector you can do as following:
z = sym([]); %declare z as an empty symbolic array
N = 6; %array size
for i = 1:N
syms(sprintf('z%d(t)', i)) %declare each element in the array as a single symbolic function
zz = symfun(sym(sprintf('z%d(t)', i)), t); %declare each element to a symbolic "handle"
z = [z;zz]; %paste the symbolic "handle" into an array
end
Be aware that matlab treats z as an 1x1 symbolic function even though it contains more elements. z will still behave like a vector, so you can use it as a normal vector in matrix-vector operations.