MATLAB: Triggering a subsystem to run for set duration
clocksimulink
Hello, I want to trigger a subsystem that will then run for 0.25 time units (more than once) at points through the simulation but I do not know how to trigger a clock. Can anyone help?
Roger
Best Answer
The solution to this problem can be solved using 'Reset clock' block written by Ravi Mravi which is very elegent and can be built out of standard blocks. This would be a clock that would be running from the start but could be set to zero at any point by a trigger. see:http://www.mathworks.com/matlabcentral/fileexchange/5761
Enabled subsystems have their own sample time, so they will continuously execute as long as the condition (your threshold, for instance) is true.
Triggered subsystems will execute once every time there is an "edge" or transition in the value of the condition -- for example, on the rising edge when the condition goes from false to true.
Best Answer