Use struct data from MATLAB workspace in Stateflow
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Cole Pratt
il 9 Lug 2020
Risposto: Mark McBroom
il 13 Lug 2020
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 Commenti
Risposta accettata
Mark McBroom
il 11 Lug 2020
In Stateflow, define your struct A as a Parameter. See attached example.
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Simulink Functions in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!