Hello,
I have the following code (it's upon GUI creation):
set(handles.time_caption,'String',datestr(now,13))tmr = timer('Name','Reminder', ... 'Period',1, ... % Update the time every 1 seconds. 'StartDelay',0, ... % In seconds. 'TasksToExecute',inf, ... % number of times to update 'ExecutionMode','fixedSpacing', ... 'TimerFcn',{@updater_mg}); start(tmr); % Start the timer object.
function [] = updater_mg(varargin) set(handles.time_caption , 'string' , datestr(now,13))end
I receive the following error:
Error while evaluating TimerFcn for timer 'Reminder' Undefined variable "handles" or class "handles.time_caption".
I understand that when I'm "inside" the updater_mg function it doesn't recognize my handles struct from a layer above.
How can I overcome this?
Best Answer