Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: COMMAND WINDOW INTERRUPT

Subject: COMMAND WINDOW INTERRUPT

From: Frank Pezzulo

Date: 27 May, 2008 23:15:04

Message: 1 of 7

Dear All,

i have an .m file and i want know how interrupt command
window when program runs. So i want interrupt command window
to see some output and then i want that the running go on.
Can you help me?

Thanks

Francesco

Subject: COMMAND WINDOW INTERRUPT

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 27 May, 2008 23:29:37

Message: 2 of 7

In article <g1i4lo$nj0$1@fred.mathworks.com>,
Frank Pezzulo <john.doe.nospam@mathworks.com> wrote:

>i have an .m file and i want know how interrupt command
>window when program runs. So i want interrupt command window
>to see some output and then i want that the running go on.
>Can you help me?

Sorry, there is no "interrupt" mechanism, and there is no
way to program the result of what happens when you try to interrupt.
You will have to find another way.

If you want to suspend execution, examine something, and then
continue, then you will need to set a breakpoint. Breakpoints
*can* be set from within a program... if you know the right place
to set them! If you just want to suspend "where-ever the program
is now", you have a problem. But you -could-, for example, have
a GUI button which set a breakpoint at a known point in a loop.
Watch out, though, for changes to the code, as breakpoints are by
line number.

If you do not need quite as much suspension, then you could
use input() to create a space in which the program is pausing
waiting for permission to continue; while it is paused in this way,
you could use use the array browser to examine global variables.
You would not be able to examine local variables, though, and
you would have to have previously told the base workspace that the
variable was global.
--
  "Tired minds don't plan well. Sleep first, plan later."
                                              -- Walter Reisch

Subject: COMMAND WINDOW INTERRUPT

From: helper

Date: 28 May, 2008 03:29:01

Message: 3 of 7

"Frank Pezzulo" <john.doe.nospam@mathworks.com> wrote in
message <g1i4lo$nj0$1@fred.mathworks.com>...
> Dear All,
>
> i have an .m file and i want know how interrupt command
> window when program runs. So i want interrupt command
window
> to see some output and then i want that the running go on.
> Can you help me?
>
> Thanks
>
> Francesco

Check out the DBLOOP function on the file exchange:

http://www.mathworks.com/matlabcentral/fileexchange/loadFile
.do?objectId=9736&objectType=file

Subject: COMMAND WINDOW INTERRUPT

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 28 May, 2008 14:02:51

Message: 4 of 7

In article <g1i5h1$h99$1@canopus.cc.umanitoba.ca>,
Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca> wrote:

>If you want to suspend execution, examine something, and then
>continue, then you will need to set a breakpoint.

I happened to notice today that -some- platforms in -some- versions
of Matlab support

  system_dependent(9);

as meaning "Throw user into the debugger".
--
Current spam load: 750-800 messages per day (March 4, 2008)

Subject: COMMAND WINDOW INTERRUPT

From: bill

Date: 28 May, 2008 14:27:40

Message: 5 of 7

On May 28, 12:15=A0am, "Frank Pezzulo" <john.doe.nos...@mathworks.com>
wrote:
> Dear All,
>
> i have an .m file and i want know how interrupt command
> window when program runs. So i want interrupt command window
> to see some output and then i want that the running go on.
> Can you help me?
>
> Thanks
>
> Francesco

Hello Francesco.

I don't know if you already know, but as well as putting breakpoints
in the m file, which other people have described, you can write the
line:

keyboard

at any point in the m-file. Then when matlab runs the file and it
reaches that point control will return to the command line, which will
have a K>> prompt. You can examine all the variables and check that
the program is in the state you would expect. Then when you type

K>>return

at the command line it will run on, to the next keyboard or the end.
hth,
Bill Weston

Subject: COMMAND WINDOW INTERRUPT

From: Gabriela Chavez

Date: 20 Jun, 2008 20:22:02

Message: 6 of 7


>
> Hello Francesco.
>
> I don't know if you already know, but as well as putting
breakpoints
> in the m file, which other people have described, you can
write the
> line:
>
> keyboard
>
> at any point in the m-file. Then when matlab runs the
file and it
> reaches that point control will return to the command
line, which will
> have a K>> prompt. You can examine all the variables and
check that
> the program is in the state you would expect. Then when
you type
>
> K>>return
>
> at the command line it will run on, to the next keyboard
or the end.
> hth,
> Bill Weston


I have been using keyboard for a while and found it very
helpful. I recently changed computers and versions and even
though the command still works (interrupts the program and
has th K>> prompt) it does not take the cursor to the
keyboard command in the editor. The arrow still appears in
the editor, but I have to scroll to it. Wold anybody know
how to solve this??

Thanks.

Subject: COMMAND WINDOW INTERRUPT

From: Gabriela Chavez

Date: 20 Jun, 2008 20:23:02

Message: 7 of 7


>
> Hello Francesco.
>
> I don't know if you already know, but as well as putting
breakpoints
> in the m file, which other people have described, you can
write the
> line:
>
> keyboard
>
> at any point in the m-file. Then when matlab runs the
file and it
> reaches that point control will return to the command
line, which will
> have a K>> prompt. You can examine all the variables and
check that
> the program is in the state you would expect. Then when
you type
>
> K>>return
>
> at the command line it will run on, to the next keyboard
or the end.
> hth,
> Bill Weston


I have been using keyboard for a while and found it very
helpful. I recently changed computers and versions and even
though the command still works (interrupts the program and
has th K>> prompt) it does not take the cursor to the
keyboard command in the editor. The arrow still appears in
the editor, but I have to scroll to it. Wold anybody know
how to solve this??

Thanks.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
keyboard Gabriela Chavez 20 Jun, 2008 16:25:12
command window interrupt Frank Pezzulo 27 May, 2008 19:40:19
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics