?? mian5.m
字號:
clear
close all
screen=get(0,'ScreenSize');
W=screen(3); H=screen(4);
figure('Color',[1,1,1],'Position',[0.2*H,0.2*H,0.6*W,0.4*H],...
'Name','切比雪夫I型低通濾波器','NumberTitle','off','MenuBar','none');
%定義PLOT菜單項
hplot=uimenu(gcf,'Label','幅度曲線');
h1=uimenu(hplot,'Label','切比雪夫');
set(h1,'CallBack',['fp=100,Rp=2,fs=130,Rs=50;','[N,fc]=cheb1ord(fp,fs,Rp,Rs,''s'');',...
'[B,A]=cheby1(N,Rp,fc,''s'');','[hf,f]=freqs(B,A,1024);',...
'axis([10,1000,0,1.1]);','semilogx(f,abs(hf));',...
'set(hgon,''Enable'',''on'');','set(hgoff,''Enable'',''on'');'...
]);
h2=uimenu(hplot,'Label','巴特沃斯');
set(h2,'CallBack',['fp=100,Rp=2,fs=130,Rs=50;','[n,fc]=buttord(fp,fs,Rp,Rs,''s'');',...
'[b,a]=butter(n,fc,''s'');','[hf,f]=freqs(b,a,1024);',...
'axis([10,1000,0,1.1]);','semilogx(f,abs(hf));',...
'set(hgon,''Enable'',''on'');','set(hgoff,''Enable'',''on'');'...
]);
%定義OPTION菜單項
hoption=uimenu(gcf,'Label','選項');
hgon=uimenu(hoption,'Label','&Grig on','CallBack','grid on','Enable','off');
hgoff=uimenu(hoption,'Label','&Grig off','CallBack','grid off','Enable','off');
hfigcor=uimenu(hoption,'Label','&Figure Color','Separator','on');
uimenu(hfigcor,'Label','&Red','Accelerator','r','CallBack','set(gcf,''Color'',''r'');');
uimenu(hfigcor,'Label','&Blue','Accelerator','b','CallBack','set(gcf,''Color'',''b'');');
uimenu(hfigcor,'Label','&Yellow','CallBack','set(gcf,''Color'',''y'');');
uimenu(hfigcor,'Label','&White','CallBack','set(gcf,''Color'',''w'');');
%定義QUIT菜單項
uimenu(gcf,'Label','退出','CallBack','close(gcf)');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -