matlabsimulink

How to compare multiple signals at once (in Simulink)


I've a question regarding Simulink. Is there an easy/fast way to compare multiple signals at once?

See my example below: enter image description here

Let's say I want to delay a signal for x steps and to see if the signal was positive for alle the last x steps?

I think in newer versions it's possible to feed an vector into to compare blocks, but unfortunately not in R2021b.

Is there a faster way to connect x signals with an AND block?


Solution

  • I would do the following: after your "Tapped Delay" block, perform the comparison to get a logical vector signal, then feed the vector signal into a "Sum" block which sums across the vector. Compare this to the width of the signal. Like this.enter image description here