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

1 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 App Building 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by