I have a problem about replacing an element in the array with a new one.
Could you please take a look and tell me what i'm doing wrong?
breedpop = 1x100 struct array with fields: sched harvvol npv penalty fitness
% every array has 10 element in it.
I tried to replace one of the element in the breedpop.penalty array(doesnt matter index of the element) this way
breedpop(i).penalty = newgeneration(i).penalty;
It works if i run once but when i run it more than 100(number of iteration) bredpop.penalty becomes more than 10 element.
How can I do it?
No products are associated with this question.