Check for valid data in edit box, clear the edit box if the data is invalid

2 ビュー (過去 30 日間)
Pankaja Tanjore
Pankaja Tanjore 2015 年 8 月 6 日
回答済み: Walter Roberson 2015 年 8 月 6 日
Hello ,
I am working on MATLAB GUI using guide. I have an edit box which takes the input(Range : 1 to 100) from the user. When i enter the data in the edit box as 200, before saving the data i want to check whether the entered number lies within the specified range.If the entered number is not within the specified range then i want to display a message that
"The entered number is not a valid number" and then clear the edit box to enter the new number.
I am using the errordlg() function to display the error message. But i am not able clear the edit box and re-enter the new valid number .
It would be grateful if you let me know how this is done.
Looking forward to hear from you.


Walter Roberson
Walter Roberson 2015 年 8 月 6 日
set(hObject, 'String', '')

その他の回答 (0 件)


Community Treasure Hunt

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

Start Hunting!

Translated by