Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Recognizing a key hit while running

Subject: Recognizing a key hit while running

From: Gang-Gyoo

Date: 28 Apr, 2010 09:05:25

Message: 1 of 2

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.

Subject: Recognizing a key hit while running

From: Sean

Date: 28 Apr, 2010 11:20:25

Message: 2 of 2

"Gang-Gyoo " <ggjin@hhu.ac.kr> wrote in message <hr8tok$24i$1@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?

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us