I have made gui where by pressing the pushbutton_2 grapgh is draw. to show any changes in the real time i have used the while loop in the function of pushbutton _2 and again some data is diplay in the text using the set(handle.text,'string',output); . when I interface this with the arduino uno borad, initialy it works fine, but athe time of closing or exit from GUI it through the following error.
hout how should I close or exit from GUI .
following are the error of programm.
----------------------------------------------------error-----------------------------------------------
Error using matlab.ui.control.UIControl/set
Invalid or deleted object.
Error in lidar>pushbutton2_Callback (line 435)
set(handles.disp1,'string',num2str(y1));
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in lidar (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)lidar('pushbutton2_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating DestroyedObject Callback.