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
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!