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 JVeff=@(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
endpower=@(J)Veff(J).*J;power(1e-2)powerdiff=diff(power(J));powerdiff(1e-2)
Best Answer