Error using matlab.ui.​control.UI​Control/se​t Invalid or deleted object inside a while loop

20 views (last 30 days)
Mafalda Couto
Mafalda Couto on 27 Feb 2018
Commented: Mafalda Couto on 28 Feb 2018
Hi.
I am trying to continuously (in real time) set a clock string in my guide and plot data in an axes window. all goes fine except when i finish/end the gui this error occurs. Can you help me?
Error using matlab.ui.control.UIControl/set Invalid or deleted object.
Error in log_display6>start_button_Callback (line 84) set(handles.clock,'String' [num2str((c(4))),':',num2str((c(5))),':',num2str(fix(c(6)))]);
Error in gui_mainfcn (line 95) feval(varargin{:});
Error in log_display6 (line 42) gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)log_display6('start_button_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating DestroyedObject Callback.
function start_button_Callback(hObject, eventdata, handles)
(...)
axes(handles.axes4);
hold on;
stop_state=get(handles.end_button,'Value');
while ~isequal(stop_state,1)
c=clock;
* set(handles.clock,'String',[num2str((c(4))),':',num2str((c(5))),':',num2str(fix(c(6)))]);
t1=now;
w=0;
plot(t1,w);
datetick('x','HH:MM');
xlim([t0 t1]);
drawnow;
pause(1);
end
  2 Comments

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!