Simulink: is there a way to only run a block once a (non-zero) signal arrives to it?
27 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!