MATLAB: How to save simulink model together with inputs given in matlab file

MATLABmatlab simulink combinationsavesimulinksimulink save

I have a simulink file whose input values are given in matlab file. When I save simulink and reopen it later, I am asked to enter the input values in matlab file once again. Is there a way to integrate a simulink and matab file together?

Best Answer

Hi,
Input arguments/variable values can be inserted within your simulink model in your case via Callbacks that can be accessed with the followings in your Simulink model window:
File -> Model Properties -> Callbacks -> InitFcn -> (Specify your inpur variables in the tab) Model initialization function
By this way, you would carry all input data along with your simulink model.
Good luck.