How to allow only sequences that have had the same value for 5 seconds (in Simulink)?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have an input like this:
[2, 2, 2, 2, 3, 2, 2, 2, 3, 4, 4, 4, 4]
I want to suppress oscillation and only allow sequences that have had the same value for x seconds (e.g. 5). So that it outputs the above sequence like this:
[2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3]
Is there a way to do this using blocks in Simulink?
댓글 수: 5
Jonas
2021년 9월 21일
I still don't know why it would output [2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3]. There has not been five consecutive '3' in the input data. If you want the data to only jump when the value is 5 times the same consecutively, the output will be:
- Input: [2, 2, 2, 2, 3, 2, 2, 2, 3, 4, 4, 4, 4]
- Output: [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Sources에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!