MATLAB: How Can I close a video while playing in MATLAB GUI

digital image processingimage processingvideovideo processing

The following error I get it while running a code file
Reference to non-existent field 'aviobj'.
Error in final>CloseVideo_Callback (line 287) handles.aviobj
Error in gui_mainfcn (line 96) feval(varargin{:});
Error in final (line 42) gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)final('CloseVideo_Callback',hObject,eventdata,guidata(hObject))

Best Answer

After you assigned a value to handles.aviobj, did you use
guidata(hObject, handles)
to update the master copy of the handles structure?