Effacer les filtres
Effacer les filtres

How to introduce Delay of milliseconds in Simulink model?

15 vues (au cours des 30 derniers jours)
Tushar Mahalle
Tushar Mahalle le 29 Nov 2018
Commenté : Tushar Mahalle le 30 Nov 2018
I have simulink model. suppose block A gives varying output (1 & 0). I need to give output of A as input to block B. But the condition is that if output of A is 1 then it is directly applied to B whereas if output is 0 then it is applied to B after delay of few milliseconds.
How to achieve this?

Réponse acceptée

Jim Riggs
Jim Riggs le 29 Nov 2018
Modifié(e) : Jim Riggs le 29 Nov 2018
Assuming that the input signal has a value of 0 or 1, I think that this will work:
You must make the following settings inside the multiport switch:
Data Port order = Zero-based contiguous
Number of data ports = 2
You can set the delay value to whatever you want inside the delay block (even a zero delay). Note that this configuration that I am showing is for a discrete loop, so you have to make sure that the simulation time step is smaller than the delay value. For example, set the simulation timestep to 1 milisecond. Set the delay to 3 for a 3 milisecond delay.
  1 commentaire
Tushar Mahalle
Tushar Mahalle le 30 Nov 2018
Thanks a lot Jim. It is working quiet nice.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by