MATLAB: Is there a TimeOut option with parsim

parsimsimulinktimeout

Is there a TimeOut option with 'parsim'? I was using this option a lot with the 'sim' command, but I cannot find such option for 'parsim'.

Best Answer

It is possible to set the TimeOut option with 'parsim' as well. To do so, you would have to define a Simulink.SimulationInput object first, and then set the TimeOut option through this object.
Any option set with 'sim' and any common model parameters can be defined through the Simulink.SimulationInput object.
Below is an example that shows how to do this using the 'vdp' model:
vdp % Open model vdp
in = Simulink.SimulationInput('vdp')
in = in.setModelParameter('TimeOut', 5) % Set time out to 5 sec
in = in.setModelParameter('StopTime', 'inf') % Set total simulation time to infinity
out = parsim(in)