I have a function fNoise() and a main.m. Both are in the attchment. When I run the main several times, some time the arrangement of elements in vector "bSolution" change and some time it is the same. I want that the arrangement of elements in the vector "bSolution" remains the same as is the arrangement of elements in each u. For example, the arrangement of elements each u is as:
But sometimes this arrangement is maintained in vector "bSolution and sometimes it is changed as:
Best estimated vector for u1: [30.1309582222756 -30.3646996283225]
Corresponding best fitness: 0.469151
Best estimated vector for u2: [40.4826960392027 -41.3736991569538 49.8771670393263]
Corresponding best fitness: 0.721330
Best estimated vector for u3: [39.795566278604 -39.1792888055757 62.4483232435389 69.5455521853215]
Corresponding best fitness: 0.687029
As you can see that the arrangement in "Best estimated vector for u1" is changed i.e., [30.1309582222756 -30.3646996283225]. Likewise, the same happens for u2 also. sometimes it happens for all the three also.
What to do so that the arrangement remains the same like each u?