Why does MATLAB R2024a throw the error "Undefined function 'timer'" when interacting with a plot/figure?
12 views (last 30 days)
Show older comments
MathWorks Support Team
on 12 Mar 2025
Edited: MathWorks Support Team
on 5 Apr 2025
MATLAB R2024a is giving the error below when plotting anything and then panning over the figure.
Warning: Error occurred while executing the listener callback for event WindowMouseMotion defined for class matlab.ui.Figure:
Undefined function 'timer' for input arguments of type 'char'.
Error in matlab.graphics.interaction.actions.Linger/startTimer
Error in matlab.graphics.interaction.actions.Linger/motionCallback
Error in matlab.graphics.interaction.actions.Linger Warning:
Error occurred while executing the listener callback for event ButtonExited defined for class matlab.graphics.primitive.canvas.JavaCanvas:
Undefined function 'timer' for input arguments of type 'char'.
Error in matlab.graphics.controls.ToolbarController/createTooltipTimer
Error in matlab.graphics.controls.ToolbarController/get.ToolTipTimer
Error in matlab.graphics.controls.ToolbarController/doButtonUnhover
Error in matlab.graphics.controls.ToolbarController/handleMouseExited
Error in matlab.graphics.controls.DesktopToolbarController/handleMouseExited
Error in matlab.graphics.controls.ToolbarController>@(e,d)obj.handleMouseExited(e,d)
This was not an issue in R2023b.
How can I fix this?
Accepted Answer
MathWorks Support Team
on 5 Apr 2025
Please follow the troubleshooting steps below:
1) Type the following command on the MATLAB "Command Window" and provide the output of it.
which timer -all
This will determine if the "timer" function is properly defined.
2) If the output is
'timer' not found
or if it does not point to your MATLAB R2024a installation folder followed by \MATLAB\R2024a\toolbox\matlab\timerfun\@timer\timer.m (e.g., by default, the path would be C:\Program Files\MATLAB\R2024a\toolbox\matlab\timerfun\@timer\timer.m), ensure that the "timer.m" file exists within that folder.
3) If the "timer.m" file exists, the issue is stemming from your MATLAB path definitions.
Please follow the instructions in
to resolve the issue. The page demonstrates how to restore the default MATLAB path and rehash the toolbox cache.
0 Comments
More Answers (0)
See Also
Categories
Find more on Software Development Tools in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!