I am looking for a way to differentiate a function formally and to find the minium of the derived function using fmin. However fmin is thought for function not for strings of symbolic expression. So either for this purpose something like
would be helpful.
Or another way is to differentiate a function and then declare the symbolic string as a new function. I wonder whether this would be possible.
What I have in mind is something like.
testfunc.m ---------------- function y=testfunc(x) y=x.^3 -------------
>> syms x >> z=diff('testfunc(x)')
Now best would be to have the string z=diff('testfunc(x)') defined as a new function, using say inline, however I was not successful. Anybody has an idea, thanks in advance.