📄 anflttbl1.m
字号:
function fig = anflttbl1();
figName='查表法设计模拟滤波器';
[existFlag,figHandle]=figflag(figName);
if existFlag,
figure(figHandle);
return;
end;
load anflttbl
gi_step=0;
%==============================
% Main Window
%==============================
h_figmain = figure('Units','normalized', ...
'Color',[0.8 0.8 0.8], ...
'Colormap',mat0, ...
'MenuBar','none', ...
'Name',figName, ...
'NumberTitle','off', ...
'PaperPosition',[18 180 576.0000000000001 432.0000000000002], ...
'PaperUnits','points', ...
'Position',[0.150390625 0.140625 0.69921875 0.69921875], ...
'Resize','off', ...
'Tag','Fig1', ...
'Visible','off');
% 4 Frames' handle initialization
h_frame=zeros(4,1);
bgcolor=[0.752941176470588 0.752941176470588 0.752941176470588];
%==============================
% Frame 1 - Design Model
%==============================
h_com=zeros(2,1);
h_frame(1) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'ListboxTop',0, ...
'Position',[0.0195530726256983 0.810408921933085 0.35195530726257 0.157992565055762], ...
'Style','frame', ...
'Tag','FrameModel', ...
'UserData','[ ]');
h1 = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'ForegroundColor',[0 0 0.501960784313725], ...
'ListboxTop',0, ...
'Position',[0.032122905027933 0.947955390334572 0.185754189944134 0.0371747211895911], ...
'String','滤波器设计目标', ...
'Style','text', ...
'Tag','StaticText0');
h1 = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'HorizontalAlignment','right', ...
'ListboxTop',0, ...
'Position',mat3, ...
'String','逼近方式', ...
'Style','text', ...
'Tag','StaticText1');
h_com(1) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',[1 1 1], ...
'FontName','宋体', ...
'FontSize',9, ...
'ListboxTop',0, ...
'Position',[0.156424581005587 0.905204460966543 0.185754189944134 0.0371747211895911], ...
'String',['巴特沃斯 ';'切比雪夫Ⅰ型'], ...
'Style','popupmenu', ...
'Tag','ModelMenu', ...
'Value',1); % ;'切比雪夫Ⅱ型'
h1 = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'HorizontalAlignment','right', ...
'ListboxTop',0, ...
'Position',mat2, ...
'String','通带形式', ...
'Style','text', ...
'Tag','StaticText2');
CallBackStr='uf_setpara(gco)';
h_com(2) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',[1 1 1], ...
'FontName','宋体', ...
'FontSize',9, ...
'ListboxTop',0, ...
'Position',[0.1564245810055866 0.8438661710037174 0.1857541899441341 0.03717472118959107], ...
'String',['低通滤波器';'高通滤波器';'带通滤波器';'带阻滤波器'], ...
'Style','popupmenu', ...
'Tag','BandMenu', ...
'Callback',CallBackStr, ...
'Value',1);
h_popband=h_com(2);
set(h_frame(1),'UserData',h_com);
%==============================
% Frame 2 - Filter Parameters
%==============================
h_com=zeros(6,3);
h_frame(2) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'ListboxTop',0, ...
'Position',[0.0195530726256983 0.455390334572491 0.35195530726257 0.323420074349442], ...
'Style','frame', ...
'Tag','FramePara');
h1 = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'ForegroundColor',[0 0 0.501960784313725], ...
'ListboxTop',0, ...
'Position',[0.032122905027933 0.756505576208178 0.136871508379888 0.0371747211895911], ...
'String','滤波器参数', ...
'Style','text', ...
'Tag','StaticText3');
ld_vstart=0.7175;
ld_vspace=0.0483;
ls_tag=['ParaTxt';'ParaVal';'ParaUnt'];
for i = 1:6,
ld_vpos = ld_vstart - ( i - 1 ) * ld_vspace ;
h_com(i,1) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'HorizontalAlignment','right', ...
'ListboxTop',0, ...
'Position',[0.026536312849162 ld_vpos 0.156424581005587 0.0371747211895911], ...
'String','123', ...
'Style','text', ...
'Tag',[ls_tag(1,:) int2str(i)]);
h_com(i,2) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',[1 1 1], ...
'FontName','宋体', ...
'FontSize',9, ...
'HorizontalAlignment','right', ...
'ListboxTop',0, ...
'Position',[0.1857541899441341 ld_vpos 0.1275418994413408 0.04275092936802974], ...
'String','0', ...
'Style','edit', ...
'Tag',[ls_tag(2,:) int2str(i)]);
h_com(i,3) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'HorizontalAlignment','left', ...
'ListboxTop',0, ...
'Position',[0.318882681564246 ld_vpos 0.0442458100558659 0.0371747211895911], ...
'String','123', ...
'Style','text', ...
'Tag',[ls_tag(3,:) int2str(i)]);
end;
set(h_frame(2),'UserData',h_com);
set(h_popband,'UserData',h_com);
%==============================
% Frame 3 - Line and Command
%==============================
h_com=zeros(4,1);
h_frame(3) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',[0.913725490196078 0.913725490196078 0.913725490196078], ...
'ListboxTop',0, ...
'Position',[0.015 0.12 0.97 0.006], ...
'Style','frame', ...
'Tag','FrameLine', ...
'UserData','[ ]');
CallBackStr='helpinfo(''anflttbl.txt'')';
h_com(1) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'ListboxTop',0, ...
'Position',mat1, ...
'String','帮 助', ...
'Callback',CallBackStr, ...
'Tag','Pushbutton1');
h_com(2) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'ListboxTop',0, ...
'Position',[0.27094972067039 0.0371747211895911 0.124301675977654 0.0613382899628253], ...
'String','上一步', ...
'CallBack','uf_fltstp(gcf,-1);', ...
'Tag','Pushbutton2');
h_com(3) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'ListboxTop',0, ...
'Position',[0.41340782122905 0.0371747211895911 0.124301675977654 0.0613382899628253], ...
'String','开 始', ...
'CallBack','uf_fltstp(gcf,1);', ...
'Tag','Pushbutton3');
CallBackStr='uf_fltclose';
h_com(4) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'ListboxTop',0, ...
'Position',[0.8100000000000001 0.0371747211895911 0.124301675977654 0.0613382899628253], ...
'String','退 出', ...
'Callback',CallBackStr, ...
'Tag','Pushbutton4');
set(h_frame(3),'UserData',h_com);
%==============================
% Frame 4 - Option, Info & Plot
%==============================
h_com=zeros(9,1);
h_com(1) = axes('Parent',h_figmain, ...
'Box','on', ...
'CameraUpVector',[0 1 0], ...
'CameraUpVectorMode','manual', ...
'Color',[1 1 1], ...
'ColorOrder',mat4, ...
'FontSize',9, ...
'Position',[0.451117318435754 0.516728624535316 0.527932960893855 0.4182156133829], ...
'Tag','Axes1', ...
'XColor',[0 0 0], ...
'XGrid','on', ...
'YColor',[0 0 0], ...
'YGrid','on', ...
'ZColor',[0 0 0]);
h2 = text('Parent',h_com(1), ...
'Color',[0 0 0], ...
'FontSize',9, ...
'HandleVisibility','off', ...
'HorizontalAlignment','center', ...
'Position',[0.4986737400530503 -0.1205357142857142 9.160254037844386], ...
'String','(x标题)', ...
'Tag','Axes1Text4', ...
'VerticalAlignment','cap');
set(h_com(1),'XLabel',h2);
h2 = text('Parent',h_com(1), ...
'Color',[0 0 0], ...
'FontSize',9, ...
'HandleVisibility','off', ...
'HorizontalAlignment','center', ...
'Position',[-0.08753315649867366 0.4955357142857143 9.160254037844386], ...
'Rotation',90, ...
'String','(y标题)', ...
'Tag','Axes1Text3', ...
'VerticalAlignment','baseline');
set(h_com(1),'YLabel',h2);
h2 = text('Parent',h_com(1), ...
'Color',[0 0 0], ...
'FontSize',9, ...
'HandleVisibility','off', ...
'HorizontalAlignment','center', ...
'Position',[0.4986737400530503 1.03125 9.160254037844386], ...
'String','图标题', ...
'Tag','Axes1Text1', ...
'VerticalAlignment','bottom');
set(h_com(1),'Title',h2);
h_com(2) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',[1 1 1], ...
'FontName','宋体', ...
'FontSize',9, ...
'HorizontalAlignment','left', ...
'ListboxTop',0, ...
'Max',100, ...
'Position',[0.0195530726256983 0.154275092936803 0.7639664804469271 0.280669144981413], ...
'String',['1';'2';'3';'4';'5';'6';'7';'8';'9'], ...
'Style','edit', ...
'Tag','InfoText');
h_frame(4) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'ListboxTop',0, ...
'Position',[0.8030726256983241 0.154275092936803 0.175977653631285 0.280669144981413], ...
'Style','frame', ...
'Tag','FrameOption');
h_com(3) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'ListboxTop',0, ...
'Position',[0.8086592178770951 0.3873370577281192 0.1201117318435754 0.037243947858473], ...
'String','显示方式', ...
'Style','text', ...
'Tag','OptionText');
CallBackStr='uf_display(1)';
h_com(4) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'HorizontalAlignment','left', ...
'ListboxTop',0, ...
'Position',[0.83 0.335195530726257 0.13 0.037243947858473], ...
'String','通带', ...
'Style','checkbox', ...
'Callback',CallBackStr, ...
'Tag','Checkbox1');
h_com(5) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'HorizontalAlignment','left', ...
'ListboxTop',0, ...
'Position',[0.83 0.283054003724395 0.13 0.037243947858473], ...
'String','阻带', ...
'Style','checkbox', ...
'Callback',CallBackStr, ...
'Tag','Checkbox2');
CallBackStr='uf_display(2)';
h_com(6) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'ListboxTop',0, ...
'Position',[0.8198324022346371 0.17877094972067 0.0684357541899441 0.074487895716946], ...
'String','定位', ...
'Style','pushbutton', ...
'Callback',CallBackStr, ...
'Tag','Pushbutton5');
CallBackStr='uf_display(3)';
h_com(7) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'ListboxTop',0, ...
'Position',[0.895 0.17877094972067 0.0684357541899441 0.074487895716946], ...
'String','缩放', ...
'Style','togglebutton', ...
'Tag','Pushbutton6', ...
'Callback',CallBackStr, ...
'UserData','[ ]');
h_com(8) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',[1 1 1], ...
'FontName','宋体', ...
'FontSize',9, ...
'HorizontalAlignment','left', ...
'Position',[0.40 0.455390334572491 0.5790502793296091 0.475], ...
'String',str2mat('a','b','c','asdffhkjkdfgfdgfdghdfhhgwetwetwetwetwetxdgxfhxfbncvncvncvnxcvncd'), ...
'Style','listbox', ...
'Tag','Listbox_Table', ...
'Value',1);
h_com(9) = uicontrol('Parent',h_figmain, ...
'Units','normalized', ...
'BackgroundColor',bgcolor, ...
'FontName','宋体', ...
'FontSize',9, ...
'ListboxTop',0, ...
'Position',[0.40 0.931157539130374 0.579 0.037243947858473], ...
'String','归一化分母多项式', ...
'Style','text', ...
'Tag','TableText');
set(h_frame(4),'UserData',h_com);
%==============================
% GUI initialized
%==============================
set(h_figmain,'UserData',[h_frame; gi_step]);
uf_fltstp(gcf,0);
set(h_figmain,'Visible','on', ...
'CloseRequestFcn','uf_fltclose');
if nargout > 0, fig = h_figmain; end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -