Error using fzero (line 306) FZERO cannot continue because user-supplied function_handle ==> @(x)((x(i)​/gemmai(i)​)*(exp(D(i​)/x(i))-1)​+x(i)-C(i)​) failed with the error below. Index exceeds array bounds. Error in abc (line 6) y=fzero(fun,12);

i am trying to solve this very simple code but facing the above error. can any body please help me?
gemmai=[2.188410605019781 0.024184639877264 3.377571120311852 0.010142425294078];
D=[1 1 1 1];
C=[1.033272967809139 0.390745943499492 0.078198616964645];
for i=3:-1:1
fun=@(x)((x(i)/gemmai(i))*(exp(D(i)/x(i))-1)+x(i)-C(i));
y=fzero(fun,12);
end

 Réponse acceptée

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by