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

4 ビュー (過去 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 Center および File ExchangeSources についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by