functions of funtions symbolic

3 views (last 30 days)
Radu Trimbitas
Radu Trimbitas on 26 Mar 2020
Answered: Walter Roberson on 27 Mar 2020
How could I define a functional (a function of functions), e.g
in MATLAB Symbolic Math Toolbox. The function f is an input parameter for L.

Answers (1)

Walter Roberson
Walter Roberson on 27 Mar 2020
You cannot do that, unfortunately.
symbolic functions at the MATLAB level are strictly created by evaluating a symbolic expression to get a result, and using symfun() to wrap the sym in an object along with a list of parameter names. At execution time, MATLAB extracts the sym, sub()'s the input value for the parameter name, and returns the result. You can never get the right level of deferment to define a useful symbolic function that operates on symbolic expressions.
You can use evalin(symengine) to define a proc at the MuPAD level, but unless you prevent the result from displaying, the MuPAD engine will reset as soon as it is to be displayed.
You can define anonymous functions that do things like
syms a b F(x)
Fint = int(F,x,a,b);
L = @(f) subs(Fint, F, f)
but L will not be a functional: it is not possible to express the deferment needed.
There just might be a way involving a using feval(symengine) to hold() an expression, but I have my doubts.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!