editbox clear command

1 view (last 30 days)
emmi rdx
emmi rdx on 22 Apr 2012
m working on application where i put a clear botton i want that whenver i click on it it would clear all the fields data so i used this code in pushbotton clear(edit3,edit4,text1); but its not working so how to do this would you please tell me........

Answers (1)

Jan
Jan on 22 Apr 2012
"It is not working" does not contain enough details to find a valuable advice. Please post the code. The CLEAR command clears variables from the workspace, but not the contents of UICONTROLs. Perhaps you want to set the contents explcitly:
set([edit3, edit4, text1], 'String', '');
  4 Comments
Daniel Shub
Daniel Shub on 22 Apr 2012
You also might need a drawnow.
Image Analyst
Image Analyst on 22 Apr 2012
If she used GUIDE, you would have to do
set(handles.edit3, 'String', '');
because the tag (the name of the edit box control) is always preceded by handles.

Sign in to comment.

Categories

Find more on Migrate GUIDE Apps 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!