Share Variables between functions in a Simulink level 2 matlab s-function .m file
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mario Seiler
am 1 Jul. 2019
Beantwortet: Samatha Aleti
am 17 Jul. 2019
Hi,
I have a level 2 matlab s function .m-file and i want to access a variable or an object which i have created in a function from another function.
In detail I have created a Matlab NET object in the function DoPostPropSetup and i want to use some methodes and access some properties of this object in the update function. How can i access this object in the update function?
I already tried to declare the variable / object as global but it didnt work. Do I have to use a block.Dwork vector? How can i do this?
Thank you very much for your help.
0 Kommentare
Akzeptierte Antwort
Samatha Aleti
am 17 Jul. 2019
Hi,
To pass an object from Simulink software to MATLAB S-Function, use Run time objects. Here is the link for the documentation:
To pass an object between 2 functions, you can pass the object as one of the input arguments.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Simulink Coder finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!