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

3 visualizzazioni (ultimi 30 giorni)
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!

Risposte (1)

Akanksha
Akanksha il 29 Ago 2025
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!

Community Treasure Hunt

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

Start Hunting!

Translated by