How to make a function/script start over

23 visualizaciones (últimos 30 días)
laurie
laurie el 9 de Mayo de 2012
Hello,
How can I make a script/function start over (as if nothing had happened) if certain criteria are not met ?
Thank you, have a nice day !

Respuesta aceptada

Walter Roberson
Walter Roberson el 9 de Mayo de 2012
You cannot do that in MATLAB. You can, however, code a "while" loop that your code breaks out of if it is satisfied that everything is okay.
  3 comentarios
laurie
laurie el 9 de Mayo de 2012
sorry i just did that and now my function is dreadfully slow ? is this to be expected ?
laurie
laurie el 9 de Mayo de 2012
sorry it was a stupid mistake ^^

Iniciar sesión para comentar.

Más respuestas (1)

Daniel Shub
Daniel Shub el 9 de Mayo de 2012
Assuming you have a logical vector x of whether or not your criteria were meet
if ~all(x)
!matlab -r myscript.m &
exit
end

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by