Stateflow Onramp - Functions in Stateflow 9.3 - Matlab functions - Bug ? Error: Illegal use of reserved keyword "end".

9 ビュー (過去 30 日間)
Soufiane Ouahi
Soufiane Ouahi 2021 年 8 月 26 日
コメント済み: Soufiane Ouahi 2021 年 8 月 30 日
Hello,
I'm following the course Stateflow Onramp and I can't valid the module number 9.
Here's the thing, when I'm done writing the code of a matlab function I click on the submit button and I get the following error :
"Error evaluating 'StopFcn' callback of block_diagram 'StateflowOnramp'.
Callback string is 'learning.simulink.modelCallbacks.stopFunction(gcs)'
Caused by:
Error: Illegal use of reserved keyword "end". "
No matter what I do afterward the submit button is frozen. I attached a screenshot to help figure out what going on.
Also I did try on both the online version of Matlab and the desktop one.
Best regards,
Soufiane

回答 (1 件)

Pavan Guntha
Pavan Guntha 2021 年 8 月 30 日
Hello Soufiane,
As explained in the Section 9.1 of Stateflow Onramp, the syntax of a MATLAB function within stateflow doesn't include 'end' keyword to be used at the end of function. You could try executing the code by removing the 'end' keyword within the function. For more information you could have a look at the following documentation page:
Hope this helps!
  1 件のコメント
Soufiane Ouahi
Soufiane Ouahi 2021 年 8 月 30 日
Thanks you very much. It was indeed the case, the syntax of a MATLAB function within stateflow differ from a normal MATLAB function. I've been able to complete the course.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by