I have a MATLAB Function Block
where I compute X variables that I want to use later in a script.
My first option was to use To Workspace
blocks for each of them, but since I have X variables, it fills up the model with blocks. The problem is that these X variables have different dimensions, otherwise I could just build a matrix.
My idea was to build a structure within the MATLAB Function Block
and then use a single To Workspace
block, but my research told me I would need a Simulink.Bus
object to do so.
Is this approach at all the best way to achieve my goal? Thanks in advance for your input!