Hi Johan,
My project is controlling a device by MPC. I want to use my designed MPC algorithm in Simulink. I used "Interpreted Matlab function" and I was successful to apply the MPC on my system during the whole run time.
But, since I only need the controller to be active in a part of my simulation time, I need the MPC block to be deactivated for the rest of the simulation time.
The thing I did was that I multiplied the MPC output to zero so that the MPC doesn't apply any output to the system whenever I don't want it to, but by doing this not only the speed of the simulation is low but also I can't use some of my constraints because those constraints would be violated by the system during the rest of simulation time.
Is there any way to deactivate the MPC Interpreted Matlab function block and activate it whenever I need it?
Best
Mahdi