Borrar filtros
Borrar filtros

After i press the pushbutton my gui closes

2 visualizaciones (últimos 30 días)
Ante
Ante el 12 de Abr. de 2013
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

Respuesta aceptada

Walter Roberson
Walter Roberson el 12 de Abr. de 2013
Your file GUI_script_test probably contains a "clear all" command.
  1 comentario
Ante
Ante el 12 de Abr. de 2013
Oh, thank you, it actually had close all and clear all.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graphics Objects en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by