Derivative of symbolic funtion at a specific value

조회 수: 2 (최근 30일)
Ahmed Elkady
Ahmed Elkady 2012년 9월 22일
댓글: Mohammad Tauquir Iqbal 2018년 7월 10일
I have a symbolic function of variable "x"
Function = @(x) 8-4.5*(x-sin (x));
say I need to get the derivative at x=5
what should i do?

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 9월 22일
편집: Azzi Abdelmalek 2012년 9월 22일
Function = @(x) 8-4.5*(x-sin (x));
Function(5)
%derivative
Function_d = @(x) diff('8-4.5*(x-sin (x))');
x=5; eval(Function_d(1))
  댓글 수: 4
Ahmed Elkady
Ahmed Elkady 2012년 9월 22일
Still not working, it gives the derivative as function of "x" but it doesn't evaluate at x=5
>> Function_d = @(x) diff('8-4.5*(x-sin (x))'); >> Function_d(5)
4.5*cos(x) - 4.5
Azzi Abdelmalek
Azzi Abdelmalek 2012년 9월 22일
편집: Azzi Abdelmalek 2012년 9월 22일
try this
Function_d = @(x) diff('8-4.5*(x-sin (x))');
x=5; eval(Function_d(1))

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Ahmed Sheta
Ahmed Sheta 2017년 4월 25일
syms x y=sin(x) a=diff(y,2,x) subs(a,x,pi/2)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by