Is there some way to measure the time difference between two successive rising edges of a pulse train signal using Simulink in MATLAB 7.7 (R2008b)?
59 views (last 30 days)
Show older comments
MathWorks Support Team
on 27 Jun 2009
Commented: Emmanouil Tzorakoleftherakis
on 3 May 2018
I would like to measure the time elapsed between two successive rising edges of a pulse train signal using Simulink in MATLAB 7.7 (R2008b).
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
Find the attached model that measures the time elapsed between two successive rising edges of a pulse train using Simulink in MATLAB 7.7 (R2008b).
This model consists of a triggered subsystem (triggered on rising edge) that has a pulse train control signal. Whenever there is a rising edge in the pulse train, the subsystem gets triggered. The input to this subsystem is a clock block (which measures the simulation time) and the output is also the same. Thus, whenever there is a rising edge in the pulse train, the subsystem outputs the simulation time. The output is held between successive triggers to the subsystem. This is illustrated by the y axis values in scope1.
The subtract block will provide the time elapsed between two successive rising edges. Scope shows this output.
2 Comments
Emmanouil Tzorakoleftherakis
on 3 May 2018
Right-clicking on the "detect_time_elapsed.mdl" and saving it as a .mdl model works for me.
More Answers (0)
See Also
Categories
Find more on Schedule Model Components in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!