Simulink: is there a way to only run a block once a (non-zero) signal arrives to it?
27 views (last 30 days)
Show older comments
Hello world,
I'm doing some offline biosignal analysis on simulink. I pass an entire set of signals (e.g. 100 seconds of duration each) to Simulink and buffer them immediately (with buffer length corresponding to fs * 100 seconds). The idea is to perform a series of sequential signal processing operations on these 100-second frames rather than by considering each sample independently.
Let's say I have a signal processing block straight after this buffering. This processing block will essentially "run twice": the first time for the first 100 seconds where there is no signal (i.e there IS a "signal" but its a just a flat 0 line), and then the second time the next 100 seconds corresponding to the actual biosignals. Now this processing block includes a plot function and a send to workspace block. So what happens is that I'm plotting an empty plot and sending nonsense to the matlab workspace on the "first" time the preprocessing block is called.
So my question is: Is there any way to run a block ONLY when a buffered non-zero signal (which may also include SOME 0 elements)? Or, alternatively, is there any way to ensure these processing blocks only run when I'd like them to?
Thank you,
Rafael
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Simulink Functions 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!