1
votes

I am using Matlab function in my simulink code where I am using the load command for getting some matrices and variables from the workspace

persistent ProblemParams;
if isempty(ProblemParams)
    ProblemParams = load('ProblemParams.mat');
end

This is working well, however there can be problem when I am running multiple simulations at the same time, hence I would like to know what other options do I have to pass an array to this block from MATLAB workspace?

1

1 Answers

2
votes

Whether or not the above works, it's not the right way to get data into the block. You should load the variable into the MATLAB Workspace prior to starting the simulation, then pass the variable into the MATLAB Function Block as a Parameter Argument.