Create an anonymous function after Symbolic differentiation
이전 댓글 표시
I want to differentiate a function f and the calculate the derivative of f at value of x. How can I do that? for example:
syms x
f=@(x) x^3+3*x+1;
g=diff(f(x))
Preferably I would like to create a function handle of the derivative and then calculate the derivative at x.
채택된 답변
추가 답변 (1개)
Iman Ansari
2013년 5월 13일
Hi.
syms x
f=@(x) x^3+3*x+1;
g=diff(f(x))
h=@(y) subs(g,y)
카테고리
도움말 센터 및 File Exchange에서 Function Creation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!