gui interface and variables

1 visualización (últimos 30 días)
Patrick Brown
Patrick Brown el 24 de En. de 2017
Comentada: Patrick Brown el 24 de En. de 2017
hi I am developing and user interface I want to select by means of a pop menu the value of a variable function popupmenu1_Callback(velocity, eventdata, handles) vel=get(velocity,'Value')
how I can do it?. I want that the value of the string in the pop menu becomes the value of the variable vel and besides, I want this variable in the workspace to do more operations
in the two lines written vel gets the value of the position and is not available in the workspace
thanks

Respuesta aceptada

Jorge Mario Guerra González
Jorge Mario Guerra González el 24 de En. de 2017
The structure to use popupmenu is something like this
function popupmenu1_Callback(hObject, eventdata, handles)
option=get(handles.popupmenu1,'value'); %Now Vel has the number of option
c=get(handles.popupmenu1,'String');
your_string=c{option} %your_string has the string value
assignin ('base','your_string',your_string) %sends it to workspace
guidata(hObject, handles);

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