How to take function as an input and differentiate it( str2func not working) ?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Operations on Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!