필터 지우기
필터 지우기

How can I create condition with changement of states on Simulink ?

조회 수: 1 (최근 30일)
Eloise Paper
Eloise Paper 2020년 6월 16일
답변: Sai Teja Paidimarri 2020년 6월 18일
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

답변 (1개)

Sai Teja Paidimarri
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 >=

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by