Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

differentiation in enonymous function condition

3 Ansichten (letzte 30 Tage)
Joon Jeon
Joon Jeon am 11 Apr. 2012
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I have an objective function which contains some function which must be differentiated before I use the object. The obj function is
T=@(E) g/E(1)+G(E)'-g/E(2)*(G(E)'+G(E)'*t)
The G(E)' is differentiated one from the following equation such as
G=@(E) phi+phi^2-g^(E(1))
G'(E) should be differentiated with respect to phi. The codes are examples so the actual function is inefficient to hand calculate. Is there any useful tool to make this function work? With the other conditions, I will to fsolve.

Antworten (1)

Walter Roberson
Walter Roberson am 11 Apr. 2012
If you have the symbolic toolbox, you should use the symbolic diff() function.
syms E
Gsym = G(E); %trick to convert anonymous function to symbolic expression
Gprime = diff(Gsym, E); %differentiate
GprimeNumeric = matlabFuntion(Gprime, E); %turn it into anon function
Then GprimeNumeric will be the matlab function handle for G'

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by