Enter a string instead of a number in edit text, warning message matlab gui

1 回表示 (過去 30 日間)
Yasin B.
Yasin B. 2015 年 1 月 11 日
コメント済み: Star Strider 2015 年 1 月 11 日
i created a gui with edit text and a pushbutton. if you enter a string instead of a number in an edit text, i want a warning message, 'You've entered a letter. Please enter a number!'
i know the warning message code; warndlg('You've entered a letter. Please enter a number!','Warning','modal');
but i dont know string/number contradiction. it can be done with if loop i believe. but how? please help.

回答 (2 件)

Star Strider
Star Strider 2015 年 1 月 11 日
I would use the isletter function.
  1 件のコメント
Star Strider
Star Strider 2015 年 1 月 11 日
My pleasure!
(If it solved your problem, please Accept my Answer.)

サインインしてコメントする。


Yasin B.
Yasin B. 2015 年 1 月 11 日
This is exactly what i'm looking for.. Thank you!

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by