MATLAB: After i press the pushbutton the gui closes

closeguipush button

I was writing a GUI that has 2 push buttons. First button runs the script that loads the data from several excel files and stores them in structure named GeneralData, then I used assignin to transfer that variable to base workspace so it can be used by other push button that will plot that data. The problem is, after I press the First push button it loads the data (The data can be seen in the base workspace), but it closes the GUI. Is there some kind of hold on that works for GUI?
Thank you for your help.
Ante
% --- Executes on button press in pushbuttonLoadjs.
function pushbuttonLoadjs_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonLoadjs (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)

GUI_script_test
%handles.GeneralData = GeneralData;
assignin('base', 'GeneralData', GeneralData)
% --- Executes on button press in Plot.
function Plot_Callback(hObject, eventdata, handles)
% hObject handle to Plot (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% MUST FIND A WAY TO GET DATA FROM BASE WORKSPACE
plot_new

Best Answer

Your file GUI_script_test probably contains a "clear all" command.