弹出菜单起初似乎是空的,在关闭并重新打开菜单后,变量会显示出来。我该如何更改它以在第一次打开时显示它。这是代码:
% --- Executes on selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu2 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu2
% Identify the first popupm menu selected option
% not strictly necessary, just used to generare the messsage box text
sel_op=get(handles.popupmenu1,'value');
% Idetify the selected option in the second popupmenu
opt=get(hObject,'value')
% Test the second popup menu selection:
%if opt == 1: the default output file has been selected
if(opt == 1)
%
% Insert here the code to save the output in the default output file