MATLAB Answers

Use struct data from MATLAB workspace in Stateflow

11 ビュー (過去 30 日間)
Cole Pratt
Cole Pratt 2020 年 7 月 9 日
回答済み: Mark McBroom 2020 年 7 月 13 日 17:25
I have a struct in the MATLAB workspace with some values and some arrays stored in it. I need to access some of the values from this struct in a Stateflow block in Simulink. What is the best way to be able to access these values?
My struct name is 'A' and I want to access the value 'b'. In Stateflow, I tried just referencing 'A.b' as I would in MATLAB, and it does not work.
I have seen that using a bus might be possible, but I cannot find a way to convert a struct to a bus and then use that bus as an input to the Stateflow.

  0 件のコメント

Sign in to comment.

採用された回答

Mark McBroom
Mark McBroom 2020 年 7 月 11 日
In Stateflow, define your struct A as a Parameter. See attached example.

  1 件のコメント

Cole Pratt
Cole Pratt 2020 年 7 月 13 日 13:00
Thanks for the help. I don't have access to MATLAB 2020a. Is there any way you can save this in a 2019b readable format?

Sign in to comment.

その他の回答 (1 件)

Mark McBroom
Mark McBroom 2020 年 7 月 13 日 17:25
Added 19b version.

  0 件のコメント

Sign in to comment.

製品


リリース

R2019b

Translated by