How do I resolve issues associated with MATLAB Runtime cache corruption?
42 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 29 Jul. 2020
Bearbeitet: MathWorks Support Team
am 5 Mai 2025
My MATLAB standalone application produced by MATLAB Compiler is no longer working. For example, I am getting errors such as
Unrecognized function or variable 'matlabrc'.
Unrecognized function or variable 'ctfroot'.
Error in => runtimeInitializationChecks.m at line 23
Or:
Undefined function or variable 'matlabrc'.
Undefined function or variable 'ctfroot'.
How do I resolve these issues?
Akzeptierte Antwort
MathWorks Support Team
am 5 Mai 2025
Bearbeitet: MathWorks Support Team
am 5 Mai 2025
When a compiled application runs, the files in the deployable archive (CTF file) are extracted to the MATLAB Runtime component cache. If this cache becomes corrupted or inaccessible, you may encounter errors such as "Undefined function or variable", or other startup errors.
To resolve these issues, clear the MATLAB Runtime cache as described in the answer below:
Change the MATLAB Runtime cache location:
If the errors persist—especially when using MATLAB Runtime R2024a or earlier, where the cache is stored in the TEMP folder—try changing MATLAB cache location. Open a Windows Command Prompt and enter:
set MCR_CACHE_ROOT=<accessible_directory>
Replace <accessible_directory> with a folder you can modify (e.g., your Desktop or a folder outside your system drive). Then run your application from the same Command Prompt. If this resolves the issue, consider adding MCR_CACHE_ROOT as a permanent environment variable. Contact your system administrator if you need help.
For additional details, see the documentation Change Options Using Environment Variables.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!