Stuck in an infinite loop



I constantly come across cases when I have to terminate a running
script file, because it enters an infinite loop. I know no solution
other than to exit mat lab from the task manager. Please suggest if
there is a better method.
Any better method will be appreciated.
.



Relevant Pages