How do I resolve issues associated with MATLAB Runtime cache corruption?

조회 수: 41 (최근 30일)
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?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2025년 5월 5일
편집: MathWorks Support Team 2025년 5월 5일
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개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by