> > Continuing in the same vein, what if I want to stop the execution >of a long loop before it's termination condition? and I still want to carry >out some processing on a partially analyzed dataset? Currently, ctrl-c breaks >the loop and I lose the intermediate results.... > > I'm running Matlab 12 on a Mac. >
You have to add your own logic. For example, Make a button and in the callback set a flag that the main loop checks on at the end of each iteration. When the main loop detects this flag is set to terminate, then it can cleanly terminate and do any other intermediate work.