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

1 次查看(过去 30 天)
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.

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

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by