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

2 views (last 30 days)
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.

Answers (2)

Star Strider
Star Strider on 11 Jan 2015
I would use the isletter function.

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

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!