Filter löschen
Filter löschen

workspace clears and handles are not working after GUIDE use

1 Ansicht (letzte 30 Tage)
Toke
Toke am 21 Jul. 2014
Beantwortet: Toke am 22 Jul. 2014
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

Akzeptierte Antwort

Jan
Jan am 21 Jul. 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.

Weitere Antworten (1)

Toke
Toke am 22 Jul. 2014
Yep, that was the problem. Thanks

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by