'if' instead of a 'switch' when auto code generation

Is there a way to make the transition in Stateflow in a Simulink model appear as an 'if' instead of a 'switch' when auto code generation?
About the criteria for 'swich' and 'if' .
Also, is there a way to set the 'Switch' or the 'If' through the Embedded Coder configuration?

回答(1 个)

You can refer to the "ConvertIfToSwitch" configuration parameter of "coder.EmbeddedCodeConfig" object to control the generation of the "switch" and "if" statements. Please refer to the following MathWorks documentation for more details.
I hope this helps.

类别

帮助中心File Exchange 中查找有关 Simulink Coder 的更多信息

产品

版本

R2017b

回答:

2024-7-5

Community Treasure Hunt

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

Start Hunting!

Translated by