当我运行我的程序进行 4 次迭代时没有问题,但是如果我运行它超过 4 次,我会收到以下错误
In an assignment A(I) = B, the number of elements in B
and
I must be the same.
对于以下行
Corresponding_value_of_x1(i)=x1(f==Lowest_value_of_the_objective_function(i));
请帮忙。
maxit=5
iga=1
x1=(6.*bin2dec(String_1))./1023
x2=(6.*bin2dec(String_2))./1023
for i=1:1:maxit
f=(x1.^2+x2-11).^2+(x1+x2.^2-7).^2;
%Displaying results from the iteration
i;
Lowest_value_of_the_objective_function(i)= min(f);
Corresponding_value_of_x1(i)=x1(f==Lowest_value_of_the_objective_function(i));
nx1=(6.*bin2dec(New_string(1)))./1023;
nx2=(6.*bin2dec(New_string(2)))./1023;
x1=nx1;
x2=nx2;
end
Corresponding_value_of_x1