필터 지우기
필터 지우기

Update variables by simulink conditional statement

조회 수: 7 (최근 30일)
Chanhyeok
Chanhyeok 2023년 8월 18일
댓글: Chanhyeok 2023년 8월 18일
U1 is yellow and u2 is blue
According to the if condition statement, when u1=100u2=0, the true interval is 10 to 50 seconds.
However, looking at the final result value(upper picture is the final one), it is converted to 1 from 10 seconds to the end.
That's my guess.
1. If conditional statement is wrong.
2. "Once" if statement is true at 10 seconds, the value is not updated and is "continued" 1.
I think number 2 is the most likely one
Is there a way to keep updating input values so that the result values are exported 1 value for 10-50 seconds only?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2023년 8월 18일
Inside the If Action subsystem, double click the Outport block, there is an option for "Output when disabled", choose "reset" instead of "held".
  댓글 수: 3
Fangjun Jiang
Fangjun Jiang 2023년 8월 18일
Then specify the initial value at the same dialog window
Chanhyeok
Chanhyeok 2023년 8월 18일
okay thank you so much

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by