How to evaluate symbolic derivative?
Ältere Kommentare anzeigen
I have created a function, powerdiff, but when I try to evaluate it at a number I get the following error message. I am wanting to evaluate it at different points to try and find the root:
Subscript indices must either be real positive integers or logicals.
Error in sym/subsref (line 805)
R_tilde = builtin('subsref',L_tilde,Idx);
Error in ivcurve_var_zoom (line 36)
powerdiff(1e-2)
Here is my code. I can evaluate the original function, power, just not powerdiff (the derivative).
syms J
Veff=@(J)0;
%Creating voltage equation
for i=1:numbg
Jph=flux(i,2);%Constant
Avalue=A(i);%Constant
V=@(J)k*t*log((Jph-J)/Avalue)+bg(i);%Voltage function
Veff=@(J)Veff(J)+V(J);%Adds to previous voltage function
end
power=@(J)Veff(J).*J;
power(1e-2)
powerdiff=diff(power(J));
powerdiff(1e-2)
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Calculus finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
