Got Questions? Get Answers.
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:
how to terminate running matlab script?

Subject: how to terminate running matlab script?

From: Em Kay

Date: 12 Jul, 2007 21:28:31

Message: 1 of 10

If i program a script that is taking longer than I expect, what is the way to stop it without closing matlab?

Subject: how to terminate running matlab script?

From: Dan Haeg

Date: 12 Jul, 2007 21:42:02

Message: 2 of 10

control - c

Subject: how to terminate running matlab script?

From: Em Kay

Date: 12 Jul, 2007 21:56:13

Message: 3 of 10

thanks a lot, somehow this has definitely sped up my work!

Subject: how to terminate running matlab script?

From: AHMET ANIL DINDAR

Date: 7 Feb, 2008 16:34:01

Message: 4 of 10

Hi all,
Is there a script instead of ctrl+c?

AAD

Subject: how to terminate running matlab script?

From: Ian Clarkson

Date: 7 Feb, 2008 16:50:03

Message: 5 of 10

"AHMET ANIL DINDAR" <adindar@iku.edu.tr> wrote in message
<fofbtp$304$1@fred.mathworks.com>...
> Hi all,
> Is there a script instead of ctrl+c?
>
> AAD

if you put: error('your quitting error message') in an
mfile, that'll hop out of your code... is that what you're
looking for?

Subject: how to terminate running matlab script?

From: AHMET ANIL DINDAR

Date: 7 Feb, 2008 17:20:20

Message: 6 of 10

That's it.

Thanks...

AAD

Subject: how to terminate running matlab script?

From: Shlomi

Date: 6 Nov, 2008 13:32:02

Message: 7 of 10

"Ian Clarkson" <ian.clarkson@gesturetek.com> wrote in message <fofcrq$i8v$1@fred.mathworks.com>...
> "AHMET ANIL DINDAR" <adindar@iku.edu.tr> wrote in message
> <fofbtp$304$1@fred.mathworks.com>...
> > Hi all,
> > Is there a script instead of ctrl+c?
> >
> > AAD
>
> if you put: error('your quitting error message') in an
> mfile, that'll hop out of your code... is that what you're
> looking for?

I'm also looking for a matlab function that replaces Ctrl+C. 'error' is not good for my purpose because it is cought somewhere along the way and my program does not stop.
I want to call the same function that makes Matlab terminate when I press Ctrl+C.

Subject: how to terminate running matlab script?

From: Walter Roberson

Date: 6 Nov, 2008 19:37:04

Message: 8 of 10

Shlomi wrote:
 
> I'm also looking for a matlab function that replaces Ctrl+C.

> I want to call the same function that makes Matlab terminate when I press Ctrl+C.

There is no way to do that in any version of Matlab that has been released to date.


--
.signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?

Subject: how to terminate running matlab script?

From: Shlomi

Date: 6 Nov, 2008 20:10:18

Message: 9 of 10

Walter Roberson <roberson@hushmail.com> wrote in message <3HHQk.22674$ID5.5580@newsfe01.iad>...
> Shlomi wrote:
>
> > I'm also looking for a matlab function that replaces Ctrl+C.
>
> > I want to call the same function that makes Matlab terminate when I press Ctrl+C.
>
> There is no way to do that in any version of Matlab that has been released to date.

Thanks, at least I'll stop trying.

Subject: how to terminate running matlab script?

From: mehmet

Date: 23 Jan, 2013 22:49:08

Message: 10 of 10



while a == 1

your script runs here

end


change the value to 0 so your script stops
a=0

Tags for 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