matlab中的gui_mainfcn(gui_State, varargin{:}提示错误 20
用matlab7.0编写了个小程序在显示几种函数的幅频特性,用了下拉菜单的插件,部分程序如下:functionpopupmenu1_Callback(hObject,ev...
用matlab7.0编写了个小程序在显示几种函数的幅频特性,用了下拉菜单的插件,部分程序如下:
function popupmenu1_Callback(hObject, eventdata, handles)
global popupmenu1
vpopmenu=get(popupmenu1,'value');%得到当前的下拉菜单的句柄值
n= str2double(get(handles.edit1,'String'));
switch vpopmenu
case 'Rectangle Window',
window=box(n);
[h,w]=freqz(window,1);
bh=angle(h);
ah=180*unwrap(bh)/pi;
axes(handles.axes1);
%subplot(1,2,1)
plot(w/pi,20*log(abs(h)/abs(h(1))));
xlabel('归一化频率');
ylabel('幅度/db');
grid
%subplot(1,2,2)
axes(handles.axes2)
plot(ah);
grid
xlabel('归一化频率')
ylabel('相位/度');
提示:
Error in ==> tp113288>popupmenu1_Callback at 81
vpopmenu==get(popupmenu1,'value');%得到当前的下拉菜单的句柄值
Error in ==> gui_mainfcn at 75
feval(varargin{:});
Error in ==> tp113288 at 44
gui_mainfcn(gui_State, varargin{:});
求改正
求高人 展开
function popupmenu1_Callback(hObject, eventdata, handles)
global popupmenu1
vpopmenu=get(popupmenu1,'value');%得到当前的下拉菜单的句柄值
n= str2double(get(handles.edit1,'String'));
switch vpopmenu
case 'Rectangle Window',
window=box(n);
[h,w]=freqz(window,1);
bh=angle(h);
ah=180*unwrap(bh)/pi;
axes(handles.axes1);
%subplot(1,2,1)
plot(w/pi,20*log(abs(h)/abs(h(1))));
xlabel('归一化频率');
ylabel('幅度/db');
grid
%subplot(1,2,2)
axes(handles.axes2)
plot(ah);
grid
xlabel('归一化频率')
ylabel('相位/度');
提示:
Error in ==> tp113288>popupmenu1_Callback at 81
vpopmenu==get(popupmenu1,'value');%得到当前的下拉菜单的句柄值
Error in ==> gui_mainfcn at 75
feval(varargin{:});
Error in ==> tp113288 at 44
gui_mainfcn(gui_State, varargin{:});
求改正
求高人 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询