Are the scripts run ONCE before every simulation? If yes, you can call them in model callback functions. Refer to the documentationhere.
If they need to be run at EVERY STEP of the simulation, you can use a MATLAB function block. Note that, this block has its limitation in the MATLAB functions it can call. Refer to the documentationhere.
Best Answer