Error is showing: "Error using plot: Unrecognized function or variable 'matlab.gr​aphics.cha​rt.interna​l.inputpar​sinutils.p​repareAxes​'"

I have installed MATLAB R2025b last week, and could not open Simulink, receiving the error that it cannot find "MATLAB/R2025b/toolbox/matlab/graphics/core/hg/hgrc.m". I have therefore added the path for that function to the path, and now suddenly, the function "plot" (outside of simulink) does not work anymore, giving the following errors:
Unrecognized function or variable 'matlab.graphics.internal.initialize'
and
Unrecognized function or variable 'matlab.graphics.chart.internal.inputparsingutils.prepareAxes'
In any case, the added path is not in the path anymore after restarting MATLAB. So this cannot actually be the reason.
How can I solve this problem?
Thanks for your help!

2 Comments

Contact Mathworks at <Product Support Page>. They support install and startup issues. Something went wrong initially or the default path wouldn't have needed munging on...
I have therefore added the path for that function to the path
Can you show the exact command you used to add the folder to the path, and any text (particularly text in orange) that the command displayed when you ran it? Perhaps that command inadvertently removed a folder from the path.
That folder ought to have been on the MATLAB path anyway, so you shouldn't have needed to add it. You can see that in MATLAB Online it is on the path (I haven't done any other path manipulation in this comment.)
P = split(path, pathsep);
hgdir = fullfile('toolbox','matlab','graphics','core','hg');
isItOnThePath = P(contains(P, hgdir))
isItOnThePath = 1×1 cell array
{'/MATLAB/toolbox/matlab/graphics/core/hg'}
When I run the command in a freshly started session of my Windows desktop installation (where again I haven't done any path manipulation) the output is:
isItOnThePath =
1×1 cell array
{'C:\Program Files\MATLAB\R2025b\toolbox\matlab\graphics\core\hg'}

Sign in to comment.

Answers (1)

Hi Jana,
To help resolve the issue you are experiencing, I recommend trying the following steps:
1. Uninstall and Reinstall MATLAB: Please uninstall MATLAB from your system and then perform a fresh installation. This will ensure that none of the MATLAB files are corrupted and will give you a clean setup.
2. Test Your Workflow: After reinstalling, try running your workflow again to see if the issue persists.
3. Reset MATLAB Path (if needed): If the problem continues, please enter the following commands in the MATLAB command window:
restoredefaultpath
rehash toolboxcache
savepath
I hope these steps will help resolve the issue.
Sincerely,
Soumya

Categories

Asked:

on 19 Mar 2026 at 14:51

Commented:

about 1 hour ago

Community Treasure Hunt

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

Start Hunting!