I have this simple system:
The code in the function is:
function a = fcn(iteration,a)
a(1,iteration) = iteration;
The outside Simulink layer is the following (a is initialized as a = zeros(1,5)):
The loop is a
and I want to store the iterator in an array (ie [1 2 3 4 5]), but for some reason Simulink initializes the array at every iterator step for a single time step, so I can only see the last value.
I have tried many different combinations, but nothing works. Do you know how I could do it?
Thank you in advance,