Say I have an array with 2 variables, LPCopen and HPCopen.
I would like to create a loop that each generation will add the same new figure 'cyclesnew' to both 'LPCopen' and 'HPCopen'. I would like to store all generations in a matrix for reference elsewhere.
The end result, would be something like;
and so on
Can anyone advise on the most efficient way to do this? It will need to be expanded to adding the cyclesnew(i) value to about 6 variable in an array. Bad code below for reference. Thanks!
for i = 1:100
cyclesnew(i) = randi(20000);
stack(i) = [LPCopen+cyclesnew(i),HPCopen+cyclesnew(i)];
population = [population ; stack(i)];
format long g