Azzera filtri
Azzera filtri

How to deal with corrupted matlabprefs?

102 visualizzazioni (ultimi 30 giorni)
LucasBar
LucasBar il 19 Ago 2024 alle 16:55
Commentato: LucasBar il 23 Ago 2024 alle 16:45
I run a matlab-script that use batch processing to collect sample from different sensors at same time.
Some sensors are connect using UDP protocol, modbus, and serial port.
As a rule, they work fine. However, sometimes I have an error related to matlabprefs.mat.
As a consequence, one of the sensors can stop to collect data, i.e., I can not read correctly form a specific serial port, and in the next time I run the same matlab script, it will fail producing some complaining about "matlabprefs.mat" (see example below).
I have this problem frequently.
I am affraid becasue If I can not deal properlly with this problem,I can not trust on matlab to control my data sample system.
Please, could you help me to figure out a deffinitive solution for this issue?
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\user\AppData\Roaming\MathWorks\MATLAB\R2023a\matlabprefs.mat. File might be corrupt.
> In hgrc (line 151)
In matlab.graphics.internal.initialize (line 15)
  9 Commenti
Walter Roberson
Walter Roberson il 23 Ago 2024 alle 1:56
What you are asking about happens to be beyond the experience of @Steven Lord . Steven Lord happens to work for Mathworks, but when he posts here, he posts as a volunteer. He is recommending that you contact Mathworks Technical Support.
LucasBar
LucasBar il 23 Ago 2024 alle 16:45
Ok, I just have to say thanks to @Steven Lord.
I already posted the issue on Mathworks Techinical Support.
My best regards

Accedi per commentare.

Risposte (1)

Animesh
Animesh il 19 Ago 2024 alle 17:00
  2 Commenti
LucasBar
LucasBar il 19 Ago 2024 alle 18:52
"removing the file helps for some time"
I know this might be a shortcut, but is not a solution. Once the error occurs, it will end the data processing and will not allow matlab starts correctly again. It is not desired that the program starts again, because there is a production chain linked to the script. Imagine this script running an airplane. Matlab should be able to fix this error, without having to restart matlab.
LucasBar
LucasBar il 19 Ago 2024 alle 18:53
We can not just remove the result of an error without solve the error because this error will came back.

Accedi per commentare.

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Prodotti


Release

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by