How to use 'Edit Text' efficiently in a GUI?
Ältere Kommentare anzeigen
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!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu String Parsing finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!