Returning from functions in debugging mode
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jonas Rosegren
el 8 de Ag. de 2019
Comentada: Jonas Rosegren
el 17 de Ag. de 2019
Hi,
Does anyone know how to force an early return to the caller from a function while in debug mode?
I have a main program calling "plug-in" m-scripts, and while developing these m-script you sometimes (quite often actually) come across bugs in the script, which forces you to quit the main program with all its previous calculations and all.
I would like to find a way of entering "return" in the command prompt to return to the main program and escape the function. Then I can update the script and clear the function from the memory and call it again without quiting the main program, which would be a great help.
Anyone experienced similar problem?
Jonas
0 comentarios
Respuesta aceptada
Sahithi Kanumarlapudi
el 14 de Ag. de 2019
You cannot force return from a function using MATLAB. But if your script files have an error you can use ‘try-catch’ blocks where you can place a ‘return’ statement in the catch block
Más respuestas (0)
Ver también
Categorías
Más información sobre Sources en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!