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

1 visualización (últimos 30 días)
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.

Respuestas (2)

Star Strider
Star Strider el 11 de En. de 2015
I would use the isletter function.

Yasin B.
Yasin B. el 11 de En. de 2015
This is exactly what i'm looking for.. Thank you!

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by