Hi everybody,I was running simulink, but after some second my pc stucked. Then I shutted down the pc brutally. When I opened Matlab, I saw the following warning:
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:load:unableToReadMatFile
Unable to read MAT-file
C:\Users\cecch\AppData\Roaming\MathWorks\MATLAB\R2017a\matlabprefs.mat. File
might be corrupt.
> In hgrc (line 163)
In initprefs (line 11)
In matlabrc (line 137)
What should I do?

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 3 Nov. 2017

5 Stimmen

I recommend deleting C:\Users\cecch\AppData\Roaming\MathWorks\MATLAB\R2017a\matlabprefs.mat . After that you will need to go in and reconfigure any preferences you had changed, such as how things dock, or hot-keys, or which warning messages you want the automatic syntax checker to look for.

7 Kommentare

dario cecchetti
dario cecchetti am 3 Nov. 2017
Thank you very much
Hongyi Gao
Hongyi Gao am 22 Okt. 2019
It works! Thanks a lot!
yash Morar
yash Morar am 12 Feb. 2020
how do you go about deleting this file?
Walter Roberson
Walter Roberson am 12 Feb. 2020
Bearbeitet: Walter Roberson am 12 Feb. 2020
You should be able to delete anything under your AppData\Roaming directory. If you cannot, then your system administrator has locked it down and you might need to get your administrator to delete it.Though I suppose that in some cases where you used Run As Administrator the first time you used MATLAB, the file could have ended up owned by Administrator.
naohachi norabuena kuroda
naohachi norabuena kuroda am 13 Mai 2020
thanks crack
Prince Ogbodum
Prince Ogbodum am 4 Sep. 2020
I can't seem to find the folder Appdata, what might be wrong??
If you still have a working-enough MATLAB, then give the command
prefdir
to find the name of the directory.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by