how to use derivation to a function from the user
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have been suggested to use anonymous function for functions from the user and it works, but now I need to do derivation of the entered function I try diff and it's not working
str = input('Please enter the function: ', 's');
f = str2func(['@(x) ',str]);
dydx=diff(f);
r1=dydx(2);
disp(r1);
2 comentarios
Stephen23
el 28 de Nov. de 2017
"I need to do derivation of the entered function"
Do you need a symbolic result or a numeric result?
Respuestas (2)
Jan
el 28 de Nov. de 2017
See https://www.mathworks.com/matlabcentral/answers/312339-how-to-convert-strings-to-symbolic-expressions-without-sym for the conversion of strings to symbolical expressions.
0 comentarios
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!