M-file Simulink pass struct data to output function
Mostra commenti meno recenti
Hello, I use the "Level-2 M-file S-Function" block to call a M-File in Simulink (setup method) where I read data from a File into a struct (OpenCRG Road Data) which is then used to compute the output of the Simulinkblock.
The problem is that I only need to read the struct data once, not at every time step, so I figured the read_file_to_struct command should take place in the "DoPostPropSetup(block)" or "InitializeConditions(block)" functions.
My problem is, that I cannot find a way to pass struct data to the output(block) function, so is there a way I haven't found yet?
I guess normaly the Dwork struct is used to pass data to the output(block) function but it only seems to be meant for vector and matrix data.
Thanks
edit: global or persistent variables don't seem to work
Risposte (0)
Categorie
Scopri di più su Simulink Coder 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!