How can I put edit text 's value in popup menu in GUI surface?

조회 수: 4 (최근 30일)
Onur PEKER
Onur PEKER 2014년 2월 23일
I am trying to plot 2 seperate graph on same axes, I am taking some values from edit text.My popup menu has two element and I want to plot this two choise according to edit text's values. But I didnt call edit text's value inside popup menu and also I want to plot axes
.
if true
function popupmenu1_Callback(hObject, eventdata, handles)
val = get(hObject,'Value'); str = get(hObject, 'String'); samplerate = str2double(get(handles.samplerate_input,'String'));
airflow_input=importdata('airflow_test_data.txt'); spo2_input=importdata('spo2_test_data.txt'); switch str{val};
case 'Airflow Area'
area(handles.axes1,airflow_area(airflow_input,samplerate));
hold off;
case 'Airflow Deviation'
area(handles.axes1,airflow_dev(airflow_input,samplerate));
hold off;
function first_input_Callback(hObject, eventdata, handles)
first_input = str2double(get(hObject,'String'));
if isnan(first_input) ~isreal(first_input)
set(handles.plot_button,'String','Cannot plot samplerate')
set(handles.plot_button,'Enable','off')
uicontrol(hObject)
else
set(handles.plot_button,'String','Plot')
set(handles.plot_button,'Enable','on')
end
function first_input_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by