I have a GUI with a timer in it. I would like to be able to update a plot every .1 seconds, however, the timer function gives me the error:
Error while evaluating TimerFcn for timer 'timer-3'
Reference to non-existent field 'concMarker'
Can anyone help me fix this? I have been reading some other posts and people have been saying you need to update the handles structure, which I am not quite sure how to do (though when I have tried copying other people's code to do so it did not work either).
axis = findobj(PumpRateGuiDisplay,'Type','axes');timerData = timer('TimerFcn',@timerFunction,... 'Period',.1,'ExecutionMode','FixedRate','BusyMode','Drop',... 'TasksToExecute',endTime*10 + 1,'Tag','timerData');function timerFunction(hObject,eventData)handles = guihandles(PumpRateGuiDisplay);handles.cocnMarker = plot(axis,NaN,NaN,'r*');timeElapsed = get(hObject,'TasksExecuted')-1;if timeElapsed ~= 0set(handles.concMarker,'XData',times(int64(timeElapsed*.1/timeIncrement)),'YData',concLeftVent(int64(timeElapsed*.1/timeIncrement)),'*');endend
Thanks in advance for the help!
Best Answer