Generated "*.m" file could not be real time updated

hello:
As showed in figure. I have a 'main.m' file, which feature is read external files and generate 'a.m' file, then run 'a.m'. I found that, after run('a.m') on 'Step 2', the resault represent that ‘a.m’ is not newest. After run 'main.m', when I check 'a.m', it is newest.
My question is there any way to run newest 'a.m' in 'main.m'.
Thank you.

 Akzeptierte Antwort

Stephen23
Stephen23 am 9 Feb. 2026
Bearbeitet: Stephen23 am 9 Feb. 2026
For performance MATLAB caches executed functions and scripts. To clear that script from the cache call CLEAR:
filename = 'a.m';
clear(filename)
run(filename)

Weitere Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2022b

Tags

Gefragt:

am 9 Feb. 2026

Kommentiert:

am 9 Feb. 2026

Community Treasure Hunt

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

Start Hunting!

Translated by