Undefined function 'stop' for input arguments of type 'double'.
4 次查看(过去 30 天)
显示 更早的评论
% 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 个评论
Stephen23
2017-11-1
@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)
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!