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

1 view (last 30 days)
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

Answers (0)

Community Treasure Hunt

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

Start Hunting!