I'm trying to run a model where the length of the vector (N_lag) changes each time I run "sim test2.slx".
for i = 1:M;
N_lag = N_lag + 1;
sim test2.slx;
end
Simulink gives me this after I accept its suggestion to name the vector (y) as a variable size vector with size [N_lag,1].
"Simulink cannot propagate the variable-size mode from the output port 1 of 'test2/Add' to the input port 1 of 'test2/Memory'. This input port expects a fixed-size mode. The variable-size mode originates from 'test2/MATLAB Function'. Examine the configurations of 'test2/Memory' for one of the following scenarios: 1) the block does not support variable-size signals; 2) the block supports variable-size signals but needs to be configured for them."
The problem is, I can't seem to find any type of block that will let me do this (global variable data stores also can't have variable size data). I'm trying to run the model a few thousand times, so hard coding the length of the vector is not an option.
The simplified block diagram is shown below.
Suggestions?
Thanks!
Best Answer