How to use 'Edit Text' efficiently in a GUI?
Show older comments
I notices that there are two ways to ues it;
The tag of edit1 is edit1.
Method 1:
function edit1_callback()
num1 = get(hObject,'string');
handles.num1 = num1;
guidatda(gcbo,handles); % why need this command?
function pshbtn1_callback()
y = handles.num1;
guidata(gcbo,handles); % why need it too?
Method 2:
function pshbtn_callback()
y = str2num(get(hObject,handles));
As shown above, what's the difference? And the effect of "guidata(gcbo,handles)" ? Thank you very much!
Accepted Answer
More Answers (0)
Categories
Find more on String Parsing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!