This is a fairly simple thing I think, but I cannot seem to get the right output that Im looking for. I am using matrices to represent state space models in simulink, and I am trying to get my states output to the workspace,

it is a simple 4x1 vector, and I tried just using the regular "to workspace" block, but it seems it concats to either a 2d or 3d vector..

I want to have a tx4 matrix output that I can reference the first state and plot for all simulation time(t) like x(:,1), the second state x(:,2) etc...

You can set a save format in a

`To Workspace`

block. Default this is set to`timeseries`

, but you can set it to`Array`

.Looking at the doc for the Array setting:

You want the first dimension not to be time, but your state vector, so transposing

`simout`

should do the trick.