How do I resolve issues associated with MATLAB Runtime cache corruption?
50 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 29 Juil 2020
Modifié(e) : MathWorks Support Team
le 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?
Réponse acceptée
MathWorks Support Team
le 5 Mai 2025
Modifié(e) : MathWorks Support Team
le 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur MATLAB Compiler dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!