How to apply validation on matlab M-file?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to put a warning message box at the click of a close button in a matlab figure.
function closed(hObject, eventdata)
close(gcbf);
warndlg('are you sure you want to close','!! Warning !!')
%clear all;
%close;clear
end
however this warning dialog box appears when the window is closed! Where should I put this messagebox exactly!
0 commentaires
Réponse acceptée
Kaustubha Govind
le 29 Avr 2011
Looks like you have your call to warndlg after "close(gcbf)". Try putting it above that.
1 commentaire
Walter Roberson
le 29 Avr 2011
And use questiondlg() instead of warndlg(), as warndlg() does not give the user any way to chose between closing or not.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!