Differentiation

조회 수: 8 (최근 30일)
Richard
Richard 2012년 1월 17일
댓글: Walter Roberson 2019년 2월 16일
Is it possible to construct a code that for example we type in x^2 and then the program finds (d/dx)x^2=0 and gives x=0?
I have tried using syms x; diff(x^2) which gives 2*x but I don't know how to make it solve the equation. Perhaps I have to define a function handle? But f=@(x) diff(x^2) doesn't work.
Please help.

채택된 답변

Walter Roberson
Walter Roberson 2012년 1월 17일
solve(diff(x^2))
  댓글 수: 1
Richard
Richard 2012년 1월 17일
Thanks, Walter! :-)

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

추가 답변 (2개)

Wayne King
Wayne King 2012년 1월 17일
syms x
solve(diff(x^2)==0)
  댓글 수: 1
Richard
Richard 2012년 1월 17일
Thanks, Wayne! :-)

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


jeevitha kandasamy
jeevitha kandasamy 2019년 2월 14일
i need matlab c code for integrator ?
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 2월 16일
Unfortunately, code generation is not supported for integral(). However, code generation is supported for the older quadgk(), so you can use MATLAB Coder with that.

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

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by