Error is showing: "Error using plot: Unrecognized function or variable 'matlab.graphics.chart.internal.inputparsinutils.prepareAxes'"
Ältere Kommentare anzeigen
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 Kommentare
dpb
am 19 Mär. 2026 um 16:31
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))
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 =
{'C:\Program Files\MATLAB\R2025b\toolbox\matlab\graphics\core\hg'}
Antworten (1)
Soumya
vor etwa 5 Stunden
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
1 Kommentar
Stephen23
vor etwa 2 Stunden
You might as well start with 3 first, before reinstalling.
Kategorien
Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!