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