After i press the pushbutton my gui closes

3 views (last 30 days)
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

Accepted Answer

Walter Roberson
Walter Roberson on 12 Apr 2013
Your file GUI_script_test probably contains a "clear all" command.
  1 Comment
Ante
Ante on 12 Apr 2013
Oh, thank you, it actually had close all and clear all.

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Objects in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!