From: Sean on
"Gang-Gyoo " <ggjin(a)hhu.ac.kr> wrote in message <hr8tok$24i$1(a)fred.mathworks.com>...
> Hello
> I am dealing with a program which runs for a long time.
> Let me know a MATLAB command which can halt the program if i hit 'q' key from the keyboard while the program are running.


One way would be to run your program with a timer function. Then you could program it so the 'q' key terminates the timer.

Also, in case it is redundant; you do know about ctrl+c or cmd+. on a mac don't you?