Borrar filtros
Borrar filtros

workspace clears and handles are not working after GUIDE use

1 visualización (últimos 30 días)
Toke
Toke el 21 de Jul. de 2014
Respondida: Toke el 22 de Jul. de 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

Respuesta aceptada

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

Más respuestas (1)

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

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by