Why are changes to MATLAB file scripts not recognized when executed with the RUN function in MATLAB?
조회 수: 5 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2010년 1월 17일
댓글: Walter Roberson
2016년 1월 30일
I have a MATLAB file script that I use to load data into the workspace. Since this script is not located on the path, I use the RUN function to execute the script. I edit this script in another editor and then save it. If I save the file in this manner in between times when it is run from MATLAB, MATLAB does not recognize the changes that were made.
I would like the RUN function to automatically refresh the cached version of my MATLAB file when I execute it.
채택된 답변
MathWorks Support Team
2010년 1월 17일
The ability to automatically refresh the cached version of a MATLAB file when the RUN function is used is not available in MATLAB.
To work around this issue, use the CLEAR function to erase the version of the script that is in memory. If the script is named 'myscript.m', enter the following at the MATLAB command prompt:
clear myscript
The script will then be reloaded when the RUN function is called again.
댓글 수: 1
Walter Roberson
2016년 1월 30일
You could try
feature('accelerator', 'off')
to attempt to disable function and script caching.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!