-3

プログラムを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
4

1 に答える 1