Simulink simulation to confirm the change of a state after n number of cycles

조회 수: 2 (최근 30일)
AJ
AJ 2020년 9월 10일
답변: Fangjun Jiang 2020년 9월 10일
Greetings,
I am trying to build a Simulink simulation of an existing electronic element that is used to confirm the change to the boolean true of the input that is maintained after a specified number of cycles n. It is fairly easy to use a matlab script, but I am trying to integrate it to logical blocks that need to be optimized, since the number of blocks is dynamic and varies with the number of cycles and I need to use this block in hundreds of instances, I can't possibly build it using the traditional way of delaying the input n times and verifying that all the delayed states are true, is there any built in function that might help me?
Algorithm:
IF IN(k) = In(k-1) =… = In(k-Nb_cycles) = true THEN
Out(k) = true
ELSE
Out(k) = false
Thank you

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2020년 9월 10일
Use a "Detect Change" block and a "Counter" block. If no change is detected for "Nb_cycles" times, the output is ture, otherwise, it is false.

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by