[MATLAB - R2011b] Transition actions are relevant only in inner/outer paths of a state.

1 回表示 (過去 30 日間)
Do Thi Bich Ngoc
Do Thi Bich Ngoc 2020 年 7 月 30 日
回答済み: Akanksha 2025 年 8 月 29 日
i have a object Stateflow.Function,
i can't set transition condition for transition in function, but Matlab R2017b is ok.
can i set transition condition for transition in function in MATLAB R2011b?
Thanks you very much!

回答 (1 件)

Akanksha
Akanksha 2025 年 8 月 29 日
In R2011b, you can’t add transition conditions directly inside graphical functions as the ability to add transition conditions (guards like [mode==ON]) inside graphical functions was not available in R2011b.
This feature was introduced in later releases .
Here is the workaround if you need to make it work in R2011b version :
  • You can use if-else statements within the function’s actions to mimic conditional logic.
  • Alternatively, try moving any conditional logic up to the parent chart instead of placing it inside the function.
Example :
function turn_boiler(mode)
if mode == ON
data = 1;
color = GREEN;
else
color = RED;
end
% continue with actions
end
Hope this helps!

カテゴリ

Help Center および File ExchangeStateflow Charts についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by