Syntax error during MBD development with Stateflow

Hello,
I am currently working on MBD development using Stateflow and have a question.
A syntax error occurs while writing the during: section of a specific state, but I am having trouble identifying the exact cause. I would greatly appreciate your help.
Thank you.

1 个评论

Haelee
Haelee 2026-7-24,8:55
编辑:Haelee 2026-7-28,0:28
Hi, 현민.
Since the screenshot appears to use C syntax, could you confirm which Action Language is selected for the chart? The supported syntax differs between MATLAB and C Action Language:
You can check this by right-clicking a blank area of the chart, selecting Properties, and reviewing the Action Language setting.
As the documentation mentions, only MATLAB action language supports "if", "for", and "while" statements in state actions. You may utilize MATLAB action language or Pattern Wizard to implement conditional logics.

请先登录,再进行评论。

回答(1 个)

Haelee
Haelee about 21 hours 前
Hi, 현민.
Since the screenshot appears to use C syntax, could you confirm which Action Language is selected for the chart? The supported syntax differs between MATLAB and C Action Language:
You can check this by right-clicking a blank area of the chart, selecting Properties, and reviewing the Action Language setting.
As the documentation mentions, only MATLAB action language supports "if", "for", and "while" statements in state actions. You may utilize MATLAB action language or Pattern Wizard to implement conditional logics.

类别

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

产品

版本

R2024b

提问:

2026-7-23,16:02

回答:

2026-8-4,7:17

Community Treasure Hunt

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

Start Hunting!