Borrar filtros
Borrar filtros

How to give input to variables in m-file from GUI

1 visualización (últimos 30 días)
KALYAN KUMAR
KALYAN KUMAR el 1 de Jul. de 2015
As i need to give inputs from GUI to m-file. I have 3 variables out of which 2 are integers and one variable will accept data input of type alpha numeric. i need to use push button to execute the code in mfile. i can do that using run(name.m). but i cant able to give input to m-file using GUI. Can any one resolve this problem. Thanks in advance
sample code used
function popupmenu8_Callback(hObject, eventdata, handles) % hObject handle to popupmenu8 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) handles = guidata(hObject); % Update! contents = get(handles.popupmenu8,'Value') switch contents case 1
S.M=7;
S.P=20;
case 2
S.M=5;
S.P=30;
otherwise
end

Respuestas (0)

Categorías

Más información sobre App Building en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by