Azzera filtri
Azzera filtri

After i press the pushbutton my gui closes

2 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Graphics Objects in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by