- Ensure that the multidimensional data is stored in a suitable MATLAB data format (eg- M x N matrix).
- Add a MATLAB function block to the Simulink model (restructuring of data can be done in this block).
- Adjust the input and output ports.(for eg - if there are M timestamps and N data points for each timestamp, the input port can be set to 'M x N' and output port to 'T x 1', where T = M * N.
- Code the MATLAB function:
- Connect the "From Workspace" block to the input port of the MATLAB Function block, and connect the output port of the MATLAB Function block to the rest of your Simulink model.
- Configure the "From Workspace" block to load the multi-dimensional data. Set the "Data Type" as a matrix and provide the appropriate variable name, such as 'data', in the "Variable name" field.