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
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 个)

类别

Help CenterFile Exchange 中查找有关 迁移使用 GUIDE 创建的 App 的更多信息

Community Treasure Hunt

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

Start Hunting!