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

 채택된 답변

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by