Use struct data from MATLAB workspace in Stateflow

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.

 Respuesta aceptada

Mark McBroom
Mark McBroom el 11 de Jul. de 2020

0 votos

In Stateflow, define your struct A as a Parameter. See attached example.

1 comentario

Cole Pratt
Cole Pratt el 13 de Jul. de 2020
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?

Iniciar sesión para comentar.

Categorías

Más información sobre Stateflow en Centro de ayuda y File Exchange.

Productos

Versión

R2019b

Etiquetas

Preguntada:

el 9 de Jul. de 2020

Respondida:

el 13 de Jul. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by