I am writing a code which refreshes the value of a text box in gui periodically .But each time my code gives me error "Error while evaluating TimerFcn for timer 'timer-19' H must be the handle to a figure or figure descendent. I have put the timer in the push button callback function so that the timer starts executing once the push button is pressed.
function s_Callback(hObject, eventdata, handles)handles.t= timer('Execution','fixedRate','Period',4.0);set(handles.t,'TimerFcn',{@u,hObject});start(handles.t);
The function to be executed is
function u(hObject, eventdata, handles)handles=guidata(hObject);a=1;set(handles.u,'String',a);
Any help would be appreciated .
Best Answer