Simulation time of From block based on values received

I have a simulink model with a from block which receives values 0 or 1 from the respective goto block. I want to know for how long the block has received the value 1 once it starts receiving 0 or vice versa during simulation. This can happen multiple times. Also the time value should be sent as input to a matlab function. How can I do this ? Can anyone help?

 Accepted Answer

Hello Senthil,
In Simulink library you can find detect change block which you can connect to the outout of your goto block and also use either integrator with a reset or a clock signal with logic block you can compute the duration of the signal. Hope it helps.

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Products

Answered:

KL
on 3 Jun 2016

Community Treasure Hunt

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

Start Hunting!