How to apply validation on matlab M-file?
조회 수: 2 (최근 30일)
이전 댓글 표시
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
채택된 답변
Kaustubha Govind
2011년 4월 29일
Looks like you have your call to warndlg after "close(gcbf)". Try putting it above that.
댓글 수: 1
Walter Roberson
2011년 4월 29일
And use questiondlg() instead of warndlg(), as warndlg() does not give the user any way to chose between closing or not.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!