Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Check keyboard without stopping?
Date: Wed, 24 Apr 2013 07:02:09 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 8
Message-ID: <kl801h$oec$1@newscl01ah.mathworks.com>
References: <kl78up$nm1$1@newscl01ah.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: www-01-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1366786929 25036 172.30.248.46 (24 Apr 2013 07:02:09 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 24 Apr 2013 07:02:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:794210

"Chuck37" wrote in message <kl78up$nm1$1@newscl01ah.mathworks.com>...
> I have a huge simulation that takes a long time to run, so I watch in real time.  I'd like a way to get into debug mode when needed, but not have to press continue every iteration.  I was hoping to be able to poll the keyboard at each iteration to see if a key is pressed.  If so, I could go into a dummy section of code (e.g. pause(0)) and have a breakpoint there so I could examine variables, etc.  If a key wasn't pressed I could sit back and watch the simulation until something unusual happened.
> 
> Is it possible?  Or maybe there's a feature of the debugger that does this some other way?

You can do within a figure/gui by using KeyPressFcn callback (and mouse button and so on). I never figure out how to do in command line.

Bruno