I have a Simulink model with blocks like: Gain, Saturation, Integrator, MATLAB Function, Constant etc.. with model workspace's parameters containing the values of the different properties of those blocks.
In addition, the Simulink model contain a state machine implemented as a Stateflow chart.
I want the project parameters, in the model workspace, to change to different sets of predetermined values for each state of the state machine.
I was told that it is not possible to access the model workspace's parameters during a run, and there are too many possible states with different sets of parameters values to make copies of sections of the Simulink model with different parameters values.
The only option that I could think of to change those parameters during the run is by replacing the different blocks containing the parameters with MATLAB Function blocks that perform the same operations and have the parameters values as input signals which will be entered by signals from a Data Store Memory block that is connected to the Stateflow chart of the state machine.
This solution prevents me from using basic Simulink blocks and instead requires the remaking of those blocks using MATLAB Function blocks, moreover the parameters values in this solution are updated by signals which makes the Simulink model far more complicated because of the big number of parameters and it is very redundant, because each signal contain the unnecessary information of a parameter value for each time of the run.
Are there any other ways to define parameters for a Simulink model and change them from a Stateflow chart during the run without using signals?