M-file Simulink pass struct data to output function
古いコメントを表示
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
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Simulink Coder についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!