Azzera filtri
Azzera filtri

workspace clears and handles are not working after GUIDE use

1 visualizzazione (ultimi 30 giorni)
I have this attached matlab code where I use GUIDE.
If I, through my GUI, run either "Run resistivity log" or "Run IP logging" the code works fine. But when the code is done running, all the handles are cleared, and also the handle-function is not working anymore. So I have to close the program and run it again for it to work.
Is there anyway to avoid this? So I can keep my handles and press either buttons several times without having to close the program each time.
I get this error if I try to press one of the buttons after I have run it one time:
??? Error using ==> get Invalid handle
Error in ==> run_logging>run_res_Callback at 94 handles.task_name = get(handles.task_name,'string');
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> run_logging at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)run_logging('run_res_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback

Risposta accettata

Jan
Jan il 21 Lug 2014
This is a bad idea:
handles.task_name = get(handles.task_name,'string');
On the right side, "handles.task_name" is a handle, on the left side this variable is a string. A second run of this function must fail.

Più risposte (1)

Toke
Toke il 22 Lug 2014
Yep, that was the problem. Thanks

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by