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

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!

カテゴリ

ヘルプ センター および File Exchange で Simulink についてさらに検索

質問済み:

2020 年 7 月 30 日

回答済み:

2025 年 8 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by