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.

 Respuesta aceptada

bym
bym el 16 de Ag. de 2011

2 votos

Ctrl-c (control + c keys)

4 comentarios

AMM Nazmul Ahsan
AMM Nazmul Ahsan el 7 de En. de 2018
It doesn't work.
Walter Roberson
Walter Roberson el 7 de En. de 2018
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 el 13 de Dic. de 2018
Make sure you click on the command window then press Ctrl + c.
Hernan Larriva
Hernan Larriva el 3 de Abr. de 2023
thank very much!

Iniciar sesión para comentar.

Más respuestas (1)

Paulo Silva
Paulo Silva el 16 de Ag. de 2011
%code
error('Mid script reached, this error message was made on purpose')
%code
Another alternative could be the use of the return function

2 comentarios

Shubha
Shubha el 8 de En. de 2014
this is cool! :)
sangmin kim
sangmin kim el 22 de Abr. de 2022
this is so cool!!

Iniciar sesión para comentar.

Categorías

Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 16 de Ag. de 2011

Comentada:

el 3 de Abr. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by