MATLAB: Simulink and Variable Sized Global Variables

global variablessimulink

I have a M-Function which reads some data at each time step, stores it in a growing dictionary (A = [A; a], where 'a' is the new data) and then uses it to produce an output.
I would like to use this function in Simulink, however I cannot see a way to create a variable sized global variable that A needs to be.
Could someone please point me in the correct direction?

Best Answer

I don't believe you can do this, at least not in an easy way. You might be better off looking into the possiblity of initialising A to its maximum size, and then selecting the part of the vector you need to use at each timestep.