求教同一个GUI中不同function间的调用
function popupmenu2_Callback(hObject, eventdata, handles)val1=get(hObject,'Value');
switch val1
case 1
handles.rv_idx = 0;
case 2
handles.rv_idx = 1;
case 3
handles.rv_idx = 2;
case 4
handles.rv_idx = 3;
end
guidata(hObject, handles);
function edit3_Callback(hObject, eventdata, handles)
val6 = str2double(get(hObject, 'String'));
handles.RBNum= val6;
guidata(hObject,handles)
function start_simulation_Callback(hObject, eventdata, handles)
flagtime = top_GUI(handles.RBNum,handles.rv_idx);
就是前两个控件分别得到handles.RBNum和handles.rv_idx,然后想把这两个参数放到top_GUI的.m文件中,调用top_GUI.m文件,但是显示
Reference to non-existent field 'rv_idx'.
Error in ==> abc>start_simulation_Callback at 432
flagtime =
top_GUI(hObject, eventdata, handles);
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> abc at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==> guidemfile>@(hObject,eventdata)abc('start_simulation_Callback',hObject,eventdata,guidata(hObject))