functions of funtions symbolic

3 ビュー (過去 30 日間)
Radu Trimbitas
Radu Trimbitas 2020 年 3 月 26 日
回答済み: Walter Roberson 2020 年 3 月 27 日
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.

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 3 月 27 日
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!

Translated by