MATLAB: S-function 2 dimension Dwork

dworks-functionsimulink

Hello,
I'm coding a state estimator (EKF) using an matlab coded s-function, and need to store the state and covariance matrix at each time step.
Is it possible to set the Dwork to a 2 dimensional matrix? If so, how? If not, are there any other alternative methods to store the covariance matrix after each step?
Thanks, Alex

Best Answer

No, AFAIK, S-function DWorks can only be vectors (1-D). Why not simply reshape the matrix to a vector and vice versa?