フィルターのクリア

How to apply validation on matlab M-file?

1 回表示 (過去 30 日間)
researcher
researcher 2011 年 4 月 29 日
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!

採用された回答

Kaustubha Govind
Kaustubha Govind 2011 年 4 月 29 日
Looks like you have your call to warndlg after "close(gcbf)". Try putting it above that.
  1 件のコメント
Walter Roberson
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 ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by