MATLAB: Matrix input/output to a Matlab function block in simulink

matlab functionsimulink

I need help creating a MATLAB function block in simulink. How do i make a MATLAB function block take in a large matrix from the workspace as its input (say a 1000 by 15 matrix), and also give its output as a matrix?

Best Answer

An alternate way is to create a parameter input in the MATLAB function block and give it the same name as the base workspace variable. Refer to Kaustubha's answer here: https://www.mathworks.com/matlabcentral/answers/40701-using-workspace-data-in-matlab-function-block-simulink and follow the instructions after "Besides TAB's solution, ...". Following link will also be helpful
A slight advantage is that you don't need to create an additional block in your model.
Related Question