Using data struct in Simulink Embedded Matlab function
Mostra commenti meno recenti
Hey guys,
I have a problem similar to the one described here:
Unfortunately when I tried the suggested solution, it only worked for simple variables but not for structs. I want to use Simulink embedded matlab functions in multiple cases. For each case I want some specific variables (which I have initialised in a script) to be know to those embedded functions. Using the suggested callback Funktion and passing the variables from the .mat I created to the simulink block worked just fine. But when I tried to pass a struct instead of seperate variables I couldn't make it work.
After trying many things, I created a bus object and passed that to the embedded function. This procedere worked but is not applicable in my case, since it is a really messy thing for so many variables.
Isn't there a better solution?
THX for your help
Risposte (2)
Kaustubha Govind
il 12 Nov 2012
1 voto
Simulink Buses are the only way to create structure signals in Simulink, so unfortunately, the only solution is to create a Simulink.Bus object for each structure type that you need to use.
Azzi Abdelmalek
il 12 Nov 2012
0 voti
What if you use these struct variables as globals
Categorie
Scopri di più su Interactive Model Editing in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!