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.

 Risposta accettata

Stephen23
Stephen23 il 9 Feb 2026
Modificato: Stephen23 il 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)

Più risposte (0)

Categorie

Scopri di più su Develop Apps Using App Designer in Centro assistenza e File Exchange

Prodotti

Release

R2022b

Tag

Richiesto:

il 9 Feb 2026

Commentato:

il 9 Feb 2026

Community Treasure Hunt

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

Start Hunting!

Translated by