So, I have three functions that I call every time step: for ii = 2:50 [G_dmg,Output2,output3] = Stages(G_dmg, Input2, Input3);
[G_dmg, output2] = decision(G_dmg);
[G_dmg] = implement(G_dmg, Input2, Input3)
To simplify my comments:
The condition will be satisfied first at ii = 4, at this iteration I want to pass G_dmg that was saved at ii = 2. And at ii = 8 I want to pass the one that was saved at ii = 3 and so on.
I would appreciate your ideas.