Differentiation

8 次查看(过去 30 天)
Richard
Richard 2012-1-17
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))

更多回答(2 个)

Wayne King
Wayne King 2012-1-17
syms x
solve(diff(x^2)==0)

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