www.gusucode.com > 使用Matlab GUI界面实现心电滤波效果交互式查看源码程序 > filter_100_1.m
function filter_100_1(ordernum,lowcut,highcut,lowlim,highlim,check,check1,hslider3,hslider4,text3,text4) [Time V1 V2 V3 V4 channelA channelB channelC channelD IO] = textread('data_100_1.dat',... '%f %f %f %f %f %f %f %f %f %f','headerlines',10); N = ordernum; T = 0.01; Wc = [2*pi*lowcut,2*pi*highcut]; Omegac = Wc*T/pi; [numd,dend] = butter(N,Omegac); x = V4(lowlim:highlim); y = filter(numd,dend,x); t = Time(lowlim:highlim); if check==1 plot(t,x,'k'); xlim([lowlim*T*1.6,highlim*T]); setvalue3(text3,hslider3); setvalue4(text4,hslider4); hc=uicontextmenu; hlcf=uimenu(hc,'Label','背景颜色'); uimenu(hlcf,'Label','白色','Call','set(gca,''Color'',[1,1,1])'); uimenu(hlcf,'Label','黄色','Call','set(gca,''Color'',[1,1,0])'); uimenu(hlcf,'Label','铜色','Call','set(gca,''Color'',[1,0.62,0.40])'); uimenu(hlcf,'Label','墨绿色','Call','set(gca,''Color'',[0.1,0.27,0.1])'); uimenu(hlcf,'Label','灰色','Call','set(gca,''Color'',[0.5,0.5,0.5])'); uimenu(hlcf,'Label','黑色','Call','set(gca,''Color'',[0,0,0])'); set(gca,'UIContextMenu',hc); if check1 == 1 pause; end end if check1 == 1 plot(t,y,'r','linewidth',1); xlim([lowlim*T*1.6,highlim*T]); hc=uicontextmenu; hlcf=uimenu(hc,'Label','背景颜色'); uimenu(hlcf,'Label','白色','Call','set(gca,''Color'',[1,1,1])'); uimenu(hlcf,'Label','黄色','Call','set(gca,''Color'',[1,1,0])'); uimenu(hlcf,'Label','铜色','Call','set(gca,''Color'',[1,0.62,0.40])'); uimenu(hlcf,'Label','墨绿色','Call','set(gca,''Color'',[0.1,0.27,0.1])'); uimenu(hlcf,'Label','灰色','Call','set(gca,''Color'',[0.5,0.5,0.5])'); uimenu(hlcf,'Label','黑色','Call','set(gca,''Color'',[0,0,0])'); set(gca,'UIContextMenu',hc); end