MATLAB: Set Simulink model simulation stop time from m file

mfilesimulink

I want to set my models simulation stop time from an m file, but I'm a little confused about how to go about it. When I'd get the data for blocks I'd use get_param, but I want to get the parameters of the model. Would I go about it the same way? Thanks.

Best Answer

You can set_param for the model also:
set_param('modelname', 'StopTime', '3000')