How to stop a program after a given time input?

I created a function in which one input is time in seconds. I want the program to stop after this time has passed. However, I am only aware of the tic toc and the cputime and I can't find out how to apply these in my situation. I hope you can help me.

1 comentario

Daniel Shub
Daniel Shub el 14 de Mayo de 2013
It really depends on what your code is doing. How exactly do you want it to "stop". Do you want MATLAB to exit?

Iniciar sesión para comentar.

Respuestas (1)

Ryan G
Ryan G el 13 de Mayo de 2013

0 votos

Try the timer object using a single shot execution mode.

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 11 de Mayo de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by