ar2015
ar2015

Reputation: 6130

Get status of progress of simulink

I need to know the progress of simulink. SimulationStatus only gives a very basic information:

get_param(gcs,'SimulationStatus')

I need something like this:

set_param(gcs, 'SimulationCommand', 'start');
pause(200)
if ??progress?? < 10 % percent
    set_param(gcs, 'SimulationCommand', 'stop');
    error('Progress so slow')
end

Upvotes: 1

Views: 1525

Answers (1)

Phil Goddard
Phil Goddard

Reputation: 10762

Use a combination of

timeNow = get_param(gcs,'SimulationTime');

and

timeEnd = get_param(gcs,'StopTime');

to determine how far into the simulation you are.

You might also want to investigate using a Timer instead of pause(200) so that your command line isn't blocked.

Upvotes: 1

Related Questions