After i press the pushbutton my gui closes

2 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2013-4-12
Your file GUI_script_test probably contains a "clear all" command.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Objects 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by