how do i re-run a script so that it takes the updated information from another script?
15 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
i have 2 scripts open. The first one includes my function. In the second script that calls on my function. If i run the code in the second script and then go back to first script and adjust some of the code, when i go back to second script to run, it doesnt notice the update i made in the first script. The way i have gotten around this is running "clear" and then starting from scratch, but i am assuming there is a cleaner way to do this?
1 Commento
per isakson
il 17 Ago 2019
Modificato: per isakson
il 17 Ago 2019
IMO: Your "program" (/system) shall consist of at most one script (the "main") together with any number of functions. Many collaborating scripts is asking for trouble.
Proposal: Show us your code or better make a minimal working example that illustrates your problem. Then we could try to cast it into a better design.
Risposte (1)
Walter Roberson
il 17 Ago 2019
MATLAB will normally notice changes to .m files that are on the current path, but not if they are installed under the MATLAB installation directory, and not consistently if you are working with a function handle to the function.
Using clear with the name of the function is the official method of dealing with this.
Vedere anche
Categorie
Scopri di più su Software Development Tools in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!