Undefined function 'stop' for input arguments of type 'double'.
4 views (last 30 days)
Show older comments
% function frameshow_Callback(hObject, eventdata, handles)
global t
global t1
t1=timer('TimerFcn',{@timerCallback1,handles},'ExecutionMode', 'fixedDelay','Period', 0.1);
guidata(hObject,handles);
stop(t);
start(t1);
function timerCallback1(hObject, eventdata, handles)
global vid
global t1
global frame
%
if (vid==-1)
msgbox('first show!');
stop(t1);
return;
end
axes(handles.axesshow);
frame=getsnapshot(vid);
imshow(frame);
i use this function to start camera but show the error:
Undefined function 'stop' for input arguments of type 'double'.
Error in colordetect>frameshow_Callback (line 55)
stop(t);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in colordetect (line 17)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)colordetect('frameshow_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
6 Comments
Stephen23
on 1 Nov 2017
@KAI XUN CAI: using global variables is only going to cause you problems. Relying on global variables is not a good way to write GUI code.
Please show us the complete output of this command:
class(t)
Answers (0)
See Also
Categories
Find more on 迁移使用 GUIDE 创建的 App in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!