Hi,
I have a Simulink model which uses solver ode45 with variable step size. In Matlab I set an index, that determines, which of two different subsystems shall be executed. A conditional block in Simulink checks, based on this index, which subsystem shall be executed. The subsystems generate a signal, which I merge with a Merge-block for the same variable in the further model.
My problem is, that I have pulse blocks in one of these subsystems. Because of that I get an error saying ".../Pulse' is not allowed within conditionally executed subsystems since it contains a variable step size sample time."
I have two different solutions right now:
1) Make two separate Simulink models and execute the right one in Matlab. Disadvantage: The most of these both models is the same and I have to apply any changes to both models.
2) Execute both subsystems and choose the right signal by a multiplexer made of basic Simulink blocks. Compare the index with its possible values by a Compare-to-constant-block. If it has value 1, multiply 1 with the signal from subsystem 1 and multiply zero with the signal from subsystem 2. Disadvantage: Very slow, because both subsystems are executed
Does anybody have another idea to solve this problem with the possibility to still use accelerator mode?
Thank you very much, Jasmin