Using data struct in Simulink Embedded Matlab function
이전 댓글 표시
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
답변 (2개)
Kaustubha Govind
2012년 11월 12일
1 개 추천
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
2012년 11월 12일
0 개 추천
What if you use these struct variables as globals
카테고리
도움말 센터 및 File Exchange에서 Interactive Model Editing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!