Hi, I have a conceptual question:
I'm creating a simulink block using a Level-2 MATLAB S-function, I need the Start function to create an object (variable1 for example), which must keep existing until the Terminate function clears it.
This variable1 object must be accessed from all the other functions called by the block, like the Output function that calculates the value of the output port of my block (I only have one), so my solution was to declare this variable1 object as global.
Is there any way to make the object exist only inside the workspace of the block I am creating, and be shared only between the registered functions of the level-2 MATLAB S-function, so I can avoid to make it global?
Thanks in advance for the answers!