필터 지우기
필터 지우기

Error message using timer

조회 수: 7 (최근 30일)
Happy PhD
Happy PhD 2021년 5월 27일
댓글: Jan 2021년 5월 28일
Hi,
Im having issues with my timers giving lots of error messages when being runned.
Im using the timer to plot a capture of an image from a camera to get a live stream of the camera.
I also want to plot the image profiles using a secon timer. They can use the same timer, but im not sure its possible.
Any idea what the issue is?
Im getting the following error;
The state of warning 'MATLAB:JavaEDTAutoDelegation' is 'off'.
Error while evaluating TimerFcn for timer 'timer-3'
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'.
Error while evaluating TimerFcn for timer 'timer-3'
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'.
Error while evaluating TimerFcn for timer 'timer-3'
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'.
Error while evaluating TimerFcn for timer 'timer-3'
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'.
Error while evaluating TimerFcn for timer 'timer-3'
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'.
Error while evaluating TimerFcn for timer 'timer-3'
My timer code:
% timer for plotting camera image
function CreateImageTimer(app)
app.timerImage = timer;
app.timerImage.StartDelay=1;
%app.timerImage.busymode='queue';
app.timerImage.ExecutionMode='fixedSpacing'; % 'fixedDelay'; %
app.timerImage.Period = 0.02;
app.timerImage.TimerFcn = @(~, ~)captureImage(app);
app.timerImage.StopFcn = @(~, ~)CleanUpImageTimer(app);
end % end function
function CleanUpImageTimer(app)
try
delete(app.timerImage)
catch
disp('error cleanup timer')
end
end % end fucntion
% timer for plotting camera image
function CreatePlotTimer(app)
app.timerPlot = timer;
app.timerPlot.StartDelay=2;
%app.timerPlot.busymode='queue';
app.timerPlot.ExecutionMode='fixedSpacing'; % 'fixedDelay'; %
app.timerPlot.Period = 0.1;
app.timerPlot.TimerFcn = @(~, ~)updateImageprofile(app);
app.timerPlot.StopFcn = @(~, ~)CleanUpImageTimer(app);
end % end function
  댓글 수: 4
Jan
Jan 2021년 5월 27일
This is a compiled application. I cannot see the source code.
Happy PhD
Happy PhD 2021년 5월 27일

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2021년 5월 27일
Incorrect dimensions for matrix multiplication. Check that the number of columns in
the first matrix matches the number of rows in the second matrix.
To perform elementwise multiplication, use '.*'.
Error while evaluating TimerFcn for timer 'timer-3'
The only matrix multiplcation I see is:
% function updateimageprofile(app,imagefile)
app.ProfileAxes_x.XTickLabel=[0:0.2:1].*XL*app.angularSize;
What is the value of app.angularSize ?
  댓글 수: 2
Happy PhD
Happy PhD 2021년 5월 28일
I don't know, it should just be a number. I can't check because when I run the program and try to debugg it, I get into a endless loop of timer-7 error print-outs and I can't quit it unless I terminate MATLAB via task manager. Cntrl C doesn't work to end it. I decided to start from the beginning and rewritten the code completely instead, taking mini steps and clean-write the code a bit. Hopefully i won't get the same issue. I honestly thought it was a timer issue and not the code for plotting because all that code is suppose to do is plot the intensity profiles of the object I have on the live feed of the camera. Thanks for trying to help.
Jan
Jan 2021년 5월 28일
You can simply insert an output to check the value of the variable before the failing line:
disp(app.angularSize)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by