0

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!

Ryan Livingston
  • 1,898
  • 12
  • 18
Alegom
  • 105
  • 1
  • 2
  • 10
  • 2
    I think you need to specify size of fields at one instance of time. Your history is saved by the To Workspace block. I assume individual sizes do not change from one time step to next. – Navan May 11 '15 at 19:25
  • Thank you for your comment, defining the dimensions solved that part and the `To Workspace` did the rest. Now the question is if this is actually the best approach to my initial problem, so I'll edit the question. – Alegom May 11 '15 at 22:58
  • 2
    If you are concerned only about simulation you could also send your data to an "extrinsic" function, accumulate it there and save it. I think using bus is better. – Navan May 12 '15 at 13:54

0 Answers0