If: No signal Then: number = "0"
2 次查看(过去 30 天)
显示 更早的评论
Is it possible for no signal to be equal to the number zero. As can be seen in the graph, with no signal I get a constant value from the previous time step, until it receives a signal again. These constantes run horizontally in the graph. Is it possible to equate these horizontal lines to zero?
3 个评论
Ameer Hamza
2018-4-24
How can you decide which output is correct and what is no signal. You mentioned that
"with no signal I get a constant value"
so does this means if you get two constant values like (..., 1, 1, ...) consecutively, the second value is corresponding to no signal. If not? then after how much consecutive constant values, you will be sure that this is no signal.
Image Analyst
2018-4-30
Do you need to do this on a "live" signal constantly coming in? Or do you want to do this on a signal that has already been captured and put into a variable (possibly after being read in from a file)?
回答(1 个)
Jan
2018-4-24
[B, N] = RunLength(Signal);
B(N > 2) = 0;
Signal = RunLength(B, N);
Now all elements which occur 3 or more times are set to 0.
5 个评论
Jan
2018-5-1
I do not work with Simulink, so I cannot give a reliable answer. But this is a new question. Please open a new thread, because it allows for keeping the overview, if you post one question per thread only.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!