Why does MATLAB R2024a throw the error "Undefined function 'timer'" when interacting with a plot/figure?
12 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2025 年 3 月 12 日
編集済み: MathWorks Support Team
2025 年 4 月 5 日
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?
採用された回答
MathWorks Support Team
2025 年 4 月 5 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Software Development Tools についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!