I am creating a MATLAB GUI where if a user presses start button, the program will load .mat file, then display analyzed data. The .mat file that I am loading is large, and it take few minutes to load data and then start showing plots from the loaded data. I want to display a message "Loading data..." (StatusMessage) while the data is being loaded so that the user doesn't think that the program froze. The code that I have below will display the message but after the data is loaded... I want the message to be displayed while the data is being loaded, not after. Any help will be greatly appreciated!
Below is the part of my code for 'Start' button:
% --- Executes on button press in Start.
function Start_Callback(hObject, eventdata, handles)
% hObject handle to Start (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Load data
set(handles.StatusMessage, 'String', num2str('Loading data...'));
load('data.mat');