I want to change the initial condition of a Simulink block, like "Unit Delay" or in my case Biquad-Filter of the DSP System Toolbox. I want to set up the initial condition of the filter with the first valid value in order that the filter is faster at the designated value. In the model, the initial condition is not a constant and can varying at every system start or simulation run. It is not possible to set up this parameter in the properties as an input port. So I have to create an Simulink.Parameter in the Model Workspace for this initial condition. How can I set or write this Simulink.Parameter during the Simulation in the Simulink-model? I found a solution to set it via MATLAB or Command Window but not in Simulink. Has somenone an solution for this issue? Is there an alternative way?
In addition I have to generate C-Code with the Embedded Coder of this filter. So the solution might be work with the Embedded Coder as well and it should not be a global variable. The calculation and the setting of the initial condition are in one function, so that it should be sufficient a local variable.
Thanks a lot in advance!