Effacer les filtres
Effacer les filtres

How to exit a GUI program?

35 vues (au cours des 30 derniers jours)
QiQin Zhan
QiQin Zhan le 27 Fév 2013
If I exit a GUI code when it is running,it will still be running in the background or maybe some errors will occur. I want to know whether there is a function that can completely exit the program and kill all errors.

Réponse acceptée

Shashank Prasanna
Shashank Prasanna le 27 Fév 2013
>> close all force
Well depends on what you want exactly, but after exist if you feel there are some hidden figures or some reason to think there is something open, the above command forces them to close. Use it when the CloseRequestFcn has been modified for example.

Plus de réponses (1)

Sean de Wolski
Sean de Wolski le 27 Fév 2013
Well to insure that there aren't errors, put in conditionals before doing something that would error.
For example: if you have a function that wants to set a textbox's string to 'Done' at the end:
h = handle to textbox
if ishandle(h) %Does thes the textbox still exist?
%Yup
set(h,'String','Done');
else
%Figure was closed!
return
end

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by