Undefined function 'graphicsversion' for input arguments of type 'matlab.ui.Figure'.

28 views (last 30 days)
Manuel Anaya
Manuel Anaya on 28 Jun 2019
Answered: Benjamin Kraus on 27 Dec 2020
Hello,
I just downloaded Matlab_R2019a. However, after I use the plot command and try to play with the plot manually the following warning/error appears, and prevents me from manipulating the plot:
Warning: Error occurred while executing the listener callback for event EnterObject
defined for class matlab.graphics.interaction.actions.Linger:
Undefined function 'graphicsversion' for input arguments of type 'matlab.ui.Figure'.
Error in uitools.uimodemanager (line 13)
if graphicsversion(hFig,'handlegraphics')
Error in uigetmodemanager (line 34)
mmgr = uitools.uimodemanager(hFig);
Error in matlab.graphics.interaction.uiaxes.DefaultAxesInteractionStrategy/isValidMouseEvent
Error in matlab.graphics.interaction.uiaxes.Datatips/validate
Error in matlab.graphics.interaction.uiaxes.Datatips/lingerEnterCallback
Error in matlab.graphics.interaction.uiaxes.Datatips>@(o,e)hObj.lingerEnterCallback(o,e)
Error in matlab.graphics.interaction.actions.Linger/enterEvent
Error in matlab.graphics.interaction.actions.Linger/motionCallback
Error in matlab.graphics.interaction.actions.Linger
In matlab.graphics.interaction.actions.Linger/enterEvent
In matlab.graphics.interaction.actions.Linger/motionCallback
In matlab.graphics.interaction.actions.Linger
Any ideas of why is this happening?
Thank you in advance,

Answers (2)

Benjamin Kraus
Benjamin Kraus on 27 Dec 2020
The graphicsversion function was undocumented and was removed in MATLAB R2018a.
You should remove any use of the graphicsversion function from your code. If you need to switch behavior based on the new graphics system vs. the old graphics system, you can use the verLessThan command.
if verLessThan('matlab','8.4')
% Old graphics system
else
% New graphics system
end
Alternatively, you can check this MATLAB Answers post for other suggestions.

Benjamin Kraus
Benjamin Kraus on 27 Dec 2020
Actually, I looked a little closer at the error message you are getting, and it looks like you have an old copy of uigetmodemanager.m on your MATLAB path. This indicates that you are likely using a pathdef.m from an old copy of MATLAB, or your pathdef.m is otherwise corrupted.
You should see if running the restoredefaultpath command in MATLAB resolves your issue:
restoredefaultpath
rehash toolboxcache
Note that the effects of this command will be lost when you restart MATLAB. If that command helps, you need to check your path and make sure it is not corrupted. One option to lock-in the fix is to call savepath, but that will cause any personal customizations to that path to be lost.
If this doesn't help, you should contact MathWorks technical support, and they can help you fix your path.

Community Treasure Hunt

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

Start Hunting!

Translated by