How to set flags in Simulink?

조회 수: 11 (최근 30일)
Pallanti Srinivasa Rao
Pallanti Srinivasa Rao 2017년 11월 12일
답변: Yogananda Jeppu 2017년 11월 13일
Hi, I have to implement the following Matlab code in Simulink. To implement if-else conditions, I have used switch block. I am facing the problem in setting flags.
flag = 0; if a > 0 { c = a + b; flag = 1; } else { c = a - b; if flag == 1; { c = 0; } flag = 0; } end
Thanks

답변 (1개)

Yogananda Jeppu
Yogananda Jeppu 2017년 11월 13일
Is the problem correct? How can flag be 1 in the else condition? Can you provide the matlab code with proper indentations. Try and use the Matlab function block if the idea is to do something quick.

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by