How to take function as an input and differentiate it( str2func not working) ?
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Operations on Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!