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

4 visualizaciones (últimos 30 días)
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

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 10 de Sept. de 2020
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.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by