How to retrieve data entered in an edit box

4 次查看(过去 30 天)
I have an edit box in my GUI. User inputs a number into the editbox and then pushes a pushbutton. when the pushbutton is pressed an external function is called. for the external function i need the number entered in the editbox. How can i used 'handles' to retrieve the data input in the edit box?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2013-3-11
编辑:Azzi Abdelmalek 2013-3-11
s=str2double(get(handles.editboxname,'string'))
% editboxname is the tag of your edit box.
  9 个评论
Azzi Abdelmalek
Azzi Abdelmalek 2013-3-11
编辑:Image Analyst 2013-3-11
The code
user_speed=str2double(get(handles.EnterSpeed,'string'));
You should put it in the pushbutton callback, NOT the edit field callback.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by