How do I access chart data inside MATLAB Functions in state flow?

4 ビュー (過去 30 日間)
Hassan Zahid Butt
Hassan Zahid Butt 2021 年 8 月 3 日
回答済み: Jorge Calvo 2021 年 10 月 5 日
I want to access all data (input, local, output) defined in a chart inside MATLAB Functions, defined in that chart. We can pass the data as input to the function but there can be dozens of input arguments (in my case). In C, we can declare variable as global and access them anywhere in any function without passing them as input arguments. How can I achieve that in stateflow? Also, is there a way to define structures so that there may be a single input and output to a given function? Ultimately, my goal is to generate a C code.

回答 (1 件)

Jorge Calvo
Jorge Calvo 2021 年 10 月 5 日
By default, a MATLAB function can access chart and state data above it in the Stateflow hierarchy. For more information, see https://www.mathworks.com/help/stateflow/ug/matlab-functions-in-a-chart.html.

カテゴリ

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