新安装了MATLAB R2021b,结果刚启动就报错
Error using builtin
Can't find the resource file 'toolbox/matlab/graphics/hg/hgrc.m' needed by 'C:\Program
Files\MATLAB\R2021b\bin\win64\hg.dll'
Error in matlab.graphics.internal.initialize (line 15)
suppressedOutput = evalc('builtin(''groot'');');
随后在运行close all
的时候也提示相同的问题
Can't find the resource file 'toolbox/matlab/graphics/hg/hgrc.m' needed by 'C:\Program
Files\MATLAB\R2021b\bin\win64\hg.dll'
此时依次运行以下三行代码即可解决:
rehash toolboxcache
restoredefaultpath
savepath
Ref:
https://www.mathworks.com/matlabcentral/answers/872683-error-after-installing-matlab-2021a
https://www.mathworks.com/matlabcentral/answers/468644-can-t-find-the-resource-file-toolbox-local-simulinkrc-m