how to load .mat in GUI every time the GUI runs and the GUI connect to simulink model?

Illustration
Kingston - 2020-09-24T14:29:13+00:00
Question: how to load .mat in GUI every time the GUI runs and the GUI connect to simulink model?

i have .mat file that contain so many variable, for example Alphabet.mat contains variable a=1,b=2,c=3,d=4..... i want to load Alphabet.mat every time i run my GUI program that contain simulink model, and also the variables inside alphabet.mat are used in simulink model... i have tried load alphabet.mat, uigetfile still cannot any suggestion??  

Expert Answer

Profile picture of John Williams John Williams answered . 2025-11-20

You call add a call to load('alphabet.mat') within the Simulink model's InitFcn callback if the parameters are only needed by the Simulink model.
From within your Simulink model see:
File->Model Properies->Callbacks


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!