How to check value of variables in Stateflow?

14 ビュー (過去 30 日間)
Jeno Boka
Jeno Boka 2022 年 7 月 5 日
編集済み: Jeno Boka 2022 年 12 月 9 日
For stateflow variables, explicitely stated in the Sybols Pane is trivial, you have many options:
  • Check the variable value on the sysbols pane
  • Move the mouse on the statement, and variables will be listed on tooltip menu
  • Add the variable to the watch
How to check the value of "local" variables, that are not explicitely listed on the Symbols Pane?
One solution may be to remove the terminating semicolon from the expression, so that MATLAB will print the result of the expression to the MATLAB console in case of MATLAB action language. But this solution has a huge overhead, slows down simulation and not very suitable to debug multiple expressions. Also requires modifying the code, which is not ideal.
Clarification: By local variables I mean variables, that are not specified on the symbols pane at all.
  1 件のコメント
Saksham Gupta
Saksham Gupta 2022 年 7 月 5 日
can you explain your problem with the help of some code? like which variable's value in particular you wish to know

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

採用された回答

Tamas Rozsa
Tamas Rozsa 2022 年 7 月 5 日
If you mean the local variables e.g. inside graphical functions (these are the ones which are not represented in Symbols Pane / Model Explorer), you can inspect them via the MATLAB Command Window, as also described on the link below:
Highlights:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComplex Logic についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by