2024a seems to have a graphics bug
75 views (last 30 days)
Show older comments
A fresh install, on a macbook with the Apple M1 chip, and a total deletion of the ~/Library/Application\ Support/MathWorks files on Macos 14.6.1, when the first command is
close all
I get the following worring error:
>> close all
Warning: Initializing MATLAB Graphics failed.
This indicates a potentially serious problem in your MATLAB
setup, which should be resolved as soon as possible. Error
detected was:
MATLAB:minrhs
Not enough input arguments.
> In hgrc (line 154)
In matlab.graphics.internal.initialize (line 15)
>> plot(rand(1,10),rand(1,10))
>> close all
>> close all
>>
However, as can be seen, everything is fine once a plot has been made.
Best, Jon
0 Comments
Answers (1)
Steven Lord
on 9 Aug 2024 at 15:15
That suggests to me that you have defined or downloaded a function that shadows one of the built-in functions used inside hgrc.m. If we look at line 154 of hgrc.m and its neighbors:
dbtype 150:160 hgrc.m
we see that it's executed when some code in the try section of the try / catch block throws an error.
Try editing hgrc.m located here (replace MATLABROOT with the root directory of your installation)
replace(string(which('-all','hgrc')), matlabroot, "MATLABROOT")
and add a keyboard statement right after the try keyword (on the next line after it) at the start of hgrc.m. Then run the steps that reproduce the warning. When MATLAB enters debug mode (the K>> prompt) step through using the debugging tools in MATLAB to determine which line in hgrc.m throws the error. Use which to check the functions being called on that line to make sure the MATLAB functions aren't being shadowed; for example if it's throwing the error from the floor function calls on line 46:
dbtype 46 hgrc.m
check that you don't have a floor.m that conflicts with the built-in floor function.
which -all floor
Once you've finished your debugging, go back to hgrc.m and remove the keyboard call since you don't want MATLAB to enter debug mode in that file every time you restart it.
0 Comments
See Also
Categories
Find more on Introduction to Installation and Licensing 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!