How to set Simulink solver type to fixed-step programmatically

You can set the solver type of a Simulink model to fixed-step programmatically using the set_param function in MATLAB. Here’s how you can do it:

set_param(gcs, 'SolverName', 'FixedStepAuto')

gcs stands for “get current system” and will return the name of the currently loaded Simulink model.

You can also specify FixedStepDiscrete or FixedStepContinuous depending on your requirements. For example:

set_param(gcs, 'SolverName', 'FixedStepDiscrete')