How can I create condition with changement of states on Simulink ?
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Sai Teja Paidimarri
2020 年 6 月 18 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Simulink Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!