Hi everybody!
Why am I having this error and how can I solve it?
I have already about this error but cannot find the way to avoid it in my case…
Thanks!!!
options=optimset('Display','iter');fzero (@(r) trapecios(r)-100, 1.21, options)function Int = trapecios (r) FC = 4.24E-1; % 0.424 para 25 V y 0.381 para 40 V
a = 6.05; % 6.050 para 25 V y 4.730 para 40 V
%FD = 8.17E-4;
%Io = 15.53;
V = 25; %N=10;
F = @(x) FC .* exp( -(V.*a) ./ (30.*x.*log(x)) ); Int = 0; part = 1e-3; L = 1:part:r; me = F(L); sum_me = sum (me); ue = F( max( L ) ); Int = part.* (sum_me - (ue/2));end
The error is:
Operands to the || and && operators must be convertible to logical scalarvalues.Error in fzero (line 365) if ~isfinite(fa) || ~isreal(fa) || ~isfinite(a)Error in Cesar_r_teor_trapecios (line 4)fzero (@(k) trapecios(k)-100, 1.21, options)
Best Answer