Differentiation

8 Ansichten (letzte 30 Tage)
Richard
Richard am 17 Jan. 2012
Kommentiert: Walter Roberson am 16 Feb. 2019
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.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 17 Jan. 2012
solve(diff(x^2))
  1 Kommentar
Richard
Richard am 17 Jan. 2012
Thanks, Walter! :-)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Wayne King
Wayne King am 17 Jan. 2012
syms x
solve(diff(x^2)==0)
  1 Kommentar
Richard
Richard am 17 Jan. 2012
Thanks, Wayne! :-)

Melden Sie sich an, um zu kommentieren.


jeevitha kandasamy
jeevitha kandasamy am 14 Feb. 2019
i need matlab c code for integrator ?
  1 Kommentar
Walter Roberson
Walter Roberson am 16 Feb. 2019
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by