How can I create condition with changement of states on Simulink ?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hello everyone !
I have some trouble to modelize a condition on Simulink, the condition is : if the button is On (value = 1) then Off (Value goes back to 0) then all the devices (lamp, audio signal...) are disabled. In order to modelize my model I have created a Chart diagram (Stateflow) with all of the outputs of my model and I have created Simulink fonctions for the transitions between the states.
In order to modelize the condition I tried the block "Detect Decrease" this block allows to output TRUE if the input is strictly less than its previous value but it doesn't work.
If you have other ideas to modelize this condition in simulink please let me know.
Thank you !
Eloise Paper
0 Commenti
Risposte (1)
Sai Teja Paidimarri
il 18 Giu 2020
hi Eloise paper,
if you wanted to change states along with the on and off button without detect decrease.you can follow these steps.
1.you can use single on and off button compared with constant using equal operator will give you 1 if button is on,0 if button is off.
2.route this single value and add to n different constants say 1+1 , 1+2 ,1+3 .. for which you get 2,3,4...
3.use direct table to create a logic you need just like demux connect it to output devices using conditional operator >=
0 Commenti
Vedere anche
Categorie
Scopri di più su Simulink Functions in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!