Save handles in GUI with Timer

2 次查看(过去 30 天)
Andrew
Andrew 2014-4-11
回答: Andrew 2014-4-14
Hello community!
I've got a GUI with timer in the OpeningFcn
handles.timer = timer(...
'ExecutionMode', 'fixedRate', ... % Run timer repeatedly
'Period', 2, ... % Initial period is 1 sec.
'TimerFcn', {@checkNewFiles2,hObject}); % Specify callback function
handles.x=1;
guidata(hObject,handles)
function checkNewFiles2(hObject,eventdata,handles)
handles=guidata(handles);
handles.x=handles.x+1;
guidata(handles, handles);
But when I'm trying to save handles in the last row, I've got an error:
Error while evaluating TimerFcn for timer 'timer-51'
H must be the handle to a figure or figure descendent.
How can I save my handles?
Thanks in advance!
Andrew

回答(1 个)

Andrew
Andrew 2014-4-14
Thanks to all! Solution is found!

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by