How to stop a script from executing

This is a basic question but I am wondering how you can halt a script from executing mid script.

 採用された回答

bym
bym 2011 年 8 月 16 日

2 投票

Ctrl-c (control + c keys)

4 件のコメント

AMM Nazmul Ahsan
AMM Nazmul Ahsan 2018 年 1 月 7 日
It doesn't work.
Walter Roberson
Walter Roberson 2018 年 1 月 7 日
It does generally work, but it does not take effect until the next time that MATLAB gets control. The symbolic computation engine is not under MATLAB's control for this purpose; and execution of heavy computation in the high performance math libraries is not under MATLAB's control for this purpose. Also, mex files and DLL are not under MATLAB's control for this purpose.
Hayden Mann
Hayden Mann 2018 年 12 月 13 日
Make sure you click on the command window then press Ctrl + c.
Hernan Larriva
Hernan Larriva 2023 年 4 月 3 日
thank very much!

サインインしてコメントする。

その他の回答 (1 件)

Paulo Silva
Paulo Silva 2011 年 8 月 16 日

1 投票

%code
error('Mid script reached, this error message was made on purpose')
%code
Another alternative could be the use of the return function

2 件のコメント

Shubha
Shubha 2014 年 1 月 8 日
this is cool! :)
sangmin kim
sangmin kim 2022 年 4 月 22 日
this is so cool!!

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

タグ

質問済み:

2011 年 8 月 16 日

コメント済み:

2023 年 4 月 3 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by