Hi, am using an timer to plot my camera onto UIAxes. I am getting error everytime I stop the timer.
I am getting the error text below, were the i value in "timer-i" changes everytime.
Error while evaluating TimerFcn for timer 'timer-19'
Matrix dimensions must agree.
when I am using the following code
function CreatePlotTimer(app)
app.timerPlot = timer;
app.timerPlot.StartDelay=1;
app.timerPlot.ExecutionMode='singleShot';
app.timerPlot.TimerFcn = @(~, ~)PlotFunction(app);
end
I am calling the Timer at this location:
if strcmp(get(app.ButtonCamera,'Text'),'Start Camera')
start(app.timerPlot)
set(app.ButtonCaptureImages,'Enable','on');
set(app.ButtonCamera,'Text','Stop Camera')
else
stop(app.timerPlot)
CreatePlotTimer(app);
set(app.ButtonCaptureImages,'Enable','off');
set(app.ButtonCamera,'Text','Start Camera')
end
Anyone knows what is going on?
Many thanks
1 Comment
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/486780-error-with-timer-timerfcn#comment_762477
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/486780-error-with-timer-timerfcn#comment_762477
Sign in to comment.