Modifying a script terminates its execution now?

Consider the following toy little script:
while true
i=1;
disp(i);
pause;
end
Save it and start running it in a Matlab window. Now open another Matlab window and modify it, say by setting
i=2;
and save it. If you are running Matlab R2021b, the script in the first window will terminate with a message that execution was terminated by user. This does not happen in R2020a, however.
This is a huge change in Matlab, as we are no longer able to run slight variations of a script simultaneously on different windows, unless we actually save them as different scripts. Has anyone else encountered this issue? Was it advertised as a new feature?

1 Kommentar

Jan
Jan am 7 Sep. 2022
What happens, if you use functions instead of scripts? Varying the input arguments is smarter than modifying the code. And if you have a bunch of Matlab sessions running different scripts, which are edited during they are running, how do you keep the overview?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2021b

Gefragt:

am 6 Sep. 2022

Kommentiert:

Jan
am 7 Sep. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by