How to take function as an input and differentiate it( str2func not working) ?
Show older comments
syms x;
y = str2func(input('Enter one variable wquation, e.g @(x)2*x - 3: ', 's'));
disp(diff(y))
In this example I have tried to write a function input from user where the diff function will differentiate the function. But the str2func does not work here. Where us the problem I can not find. Can anyone please help me?
I just want to take input from user a function and differentiate it
Accepted Answer
More Answers (0)
Categories
Find more on Operations on Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!