Borrar filtros
Borrar filtros

How to retrieve data entered in an edit box

1 visualización (últimos 30 días)
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?

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 11 de Mzo. de 2013
Editada: Azzi Abdelmalek el 11 de Mzo. de 2013
s=str2double(get(handles.editboxname,'string'))
% editboxname is the tag of your edit box.
  9 comentarios
Azzi Abdelmalek
Azzi Abdelmalek el 11 de Mzo. de 2013
Editada: Image Analyst el 11 de Mzo. de 2013
The code
user_speed=str2double(get(handles.EnterSpeed,'string'));
You should put it in the pushbutton callback, NOT the edit field callback.
Achchuthan Ganeshanathan
Achchuthan Ganeshanathan el 11 de Mzo. de 2013
thankyou that has done the trick

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by