Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

How to get current time of simulation while Model is executing.

Asked by Kumar Nikhil

Kumar Nikhil (view profile)

on 3 Jan 2013
Accepted Answer by TAB

TAB (view profile)

I want to execute many test cases one by one. For this,I want to execute a test case after every 50 simulation seconds. For this I want to get simulation time data runtime. Thank you.

0 Comments

Kumar Nikhil

Kumar Nikhil (view profile)

Products

No products are associated with this question.

3 Answers

Answer by TAB

TAB (view profile)

on 3 Jan 2013
Accepted answer

See

Access Block Data During Simulation.

To read the current simulation time of model from matlab, use

get_param('YourModel','SimulationTime')

1 Comment

David

David (view profile)

on 14 May 2013

PERFECT! thanks.

TAB

TAB (view profile)

Answer by Azzi Abdelmalek

Azzi Abdelmalek (view profile)

on 3 Jan 2013

You can use a clock block from simulink/sources with math function block (set to mod) and a constant block.

every 50s the output will be set to 0

0 Comments

Azzi Abdelmalek

Azzi Abdelmalek (view profile)

Answer by Suneesh

Suneesh (view profile)

on 3 Jan 2013

0 Comments

Suneesh

Suneesh (view profile)

Contact us