필터 지우기
필터 지우기

while loop step is not working in simulink

조회 수: 2 (최근 30일)
환곤
환곤 2022년 12월 26일
댓글: 환곤 2022년 12월 26일
hello
My simulink diagram is looping 4times
During loop, make some flg signal ( [1,0,0,0] )
And run subsystemblock, it is not make 4 signal just 2signal.
how can i make 4 signal in below diagram ?
1. loop 4times
2. make flg signal in 4times while loop ( [ 1,0,0,0] )
3. subsystem run useing by flg signal
4. now result - only make 2signals.

채택된 답변

Walter Roberson
Walter Roberson 2022년 12월 26일
Switch / Action ports do not create new signals each time a new sample is processed through them. Any one branch is turned on or off, but remains that way until it is changed. So you have one signal transition when flg is 1, and another when flg first becomes 0 -- but then it stays that way with the 0s that follow.
Think of it as being like an on/off switch. The switch is turned on with the first 1, and then it stays on until the time of the first 0, at which point it is turned off. And it then stays off. The switch is not effectively reversed on at each candidate time: if the input value does not change, there is no transition.
  댓글 수: 1
환곤
환곤 2022년 12월 26일
Thank you for your answer.
The answer is very useful!
I solved the problem, use memory store block.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by