MATLAB Answers

How to save the time of the simulink simulation on matlab?

2 views (last 30 days)
Gianmarco Morelli
Gianmarco Morelli on 24 Oct 2020
Answered: Fangjun Jiang on 26 Oct 2020
Hello,
I need to create an "if" block on simulink, the block must be triggered when the simulation time is =0. My idea was to save the simulation time of simulink on a matlab variable and then to use it on simulink in a constant block.
Someone knows how to do that?

  1 Comment

Mathieu NOE
Mathieu NOE on 26 Oct 2020
hello
I have some difficulty to understand what your intention is
what is the reason to trigger (once ?) at t= 0 ?
or do you want to save a "hit" time when the trigger condition occurs ?

Sign in to comment.

Answers (1)

Fangjun Jiang
Fangjun Jiang on 26 Oct 2020
Use the Clock block in your Simulink model. It outputs the simulation time. Do whatever you want.

  0 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!