How to Hold the sensor values for 10s and update the output value (boolean) using simulink

조회 수: 1 (최근 30일)
I receive value from temperature sensor continously at 100ms step size.
If the value from sensor is same for continous 10s, then the output value should be 1
If the value from sensor is not same, then the output value should be 0.
Can anyone help me on this with the simulink design or atleast the blocks to be used to hold the values for 10s

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2023년 5월 9일
Use a Unit Delay block to store the previous value. I assume that is what you will use to compare "If the value from sensor is same".
The comparison will generate a TRUE or FALSE signal. Feed this signal to an Integrator block, which has its Reset option enabled. If the comparison output is FALSE, use it to reset the integrator. The comparison output is also always feed into the input of the integrator. If the comparison is always TRUE, the output of the integrator will keep increasing. Compare it with 10, you will get the desired output.

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by