?? mm3.m
字號:
clc;
close all;
clear;
load 101.mat;
x=D101(:,1);
y=D101(:,2);
subplot(5,1,1);
plot(x,y);
axis([0 60 -1 2]);
% above original ECG signal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
n=0;
m=0;
E101=D101;
F101=D101;
ES=[1,1,1];
IS=[5,5,5];
for n=1:1:21597
for m=1:1:3
IS(m)=F101(n+m,2)-ES(m);
end
E101(n,2)=min(IS);
end
for n=21598:1:21599
for m=1:1:3-(n-21597)
IS(m)=F101(n+m,2)-ES(m);
end
E101(n,2)=min(IS);
end
y0=E101(:,2);
subplot(5,1,2);
plot(x,y0);
axis([0 4 -1 3]);
n=0;
m=0;
G101=E101;
H101=E101;
ES=[1,1,1];
IS=[-5,-5,-5];
for n=2:1:3
for m=1:1:n-1
IS(m)=H101(n-m,2)+ES(m);
end
G101(n,2)=max(IS);
end
for n=4:1:21600
for m=1:1:3
IS(m)=H101(n-m,2)+ES(m);
end
G101(n,2)=max(IS);
end
y1=G101(:,2);
Subplot(5,1,3);
plot(x,y1);
axis([0 4 -1 0.8]);
n=0;
m=0;
E101=G101;
F101=G101;
ES=[1,1,1];
IS=[-5,-5,-5];
for n=2:1:3
for m=1:1:n-1
IS(m)=F101(n-m,2)+ES(m);
end
E101(n,2)=max(IS);
end
for n=4:1:21600
for m=1:1:3
IS(m)=F101(n-m,2)+ES(m);
end
E101(n,2)=max(IS);
end
y2=E101(:,2);
subplot(5,1,4);
plot(x,y2);
axis([0 4 -1 3]);
n=0;
m=0;
G101=E101;
H101=E101;
ES=[1,1,1];
IS=[5,5,5];
for n=1:1:21596
for m=1:1:3
IS(m)=H101(n+m,2)-ES(m);
end
G101(n,2)=min(IS);
end
ES=[1,1,1];
IS=[5,5,5];
for n=21598:1:21599
for m=1:1:3-(n-21597)
IS(m)=H101(n+m,2)-ES(m);
end
G101(n,2)=min(IS);
end
y3=G101(:,2);
Subplot(5,1,5);
plot(x,y3);
axis([0 4 -1 0.8]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure;
subplot(5,1,1);
plot(x,y);
axis([0 4 -1 2]);
n=0;
m=0;
E101=D101;
F101=D101;
ES=[1,1,1];
IS=[-5,-5,-5];
for n=2:1:3
for m=1:1:n-1
IS(m)=F101(n-m,2)+ES(m);
end
E101(n,2)=max(IS);
end
for n=4:1:21600
for m=1:1:3
IS(m)=F101(n-m,2)+ES(m);
end
E101(n,2)=max(IS);
end
y4=E101(:,2);
subplot(5,1,2);
plot(x,y4);
axis([0 4 -1 3]);
n=0;
m=0;
G101=E101;
H101=E101;
ES=[1,1,1];
IS=[5,5,5];
for n=1:1:21596
for m=1:1:3
IS(m)=H101(n+m,2)-ES(m);
end
G101(n,2)=min(IS);
end
ES=[1,1,1];
IS=[5,5,5];
for n=21598:1:21599
for m=1:1:3-(n-21597)
IS(m)=H101(n+m,2)-ES(m);
end
G101(n,2)=min(IS);
end
y5=G101(:,2);
Subplot(5,1,3);
plot(x,y5);
axis([0 4 -1 0.8]);
n=0;
m=0;
E101=G101;
F101=G101;
ES=[1,1,1];
IS=[5,5,5];
for n=1:1:21597
for m=1:1:3
IS(m)=F101(n+m,2)-ES(m);
end
E101(n,2)=min(IS);
end
for n=21598:1:21599
for m=1:1:3-(n-21597)
IS(m)=F101(n+m,2)-ES(m);
end
E101(n,2)=min(IS);
end
y6=E101(:,2);
subplot(5,1,4);
plot(x,y6);
axis([0 4 -1 3]);
n=0;
m=0;
G101=E101;
H101=E101;
ES=[1,1,1];
IS=[-5,-5,-5];
for n=2:1:3
for m=1:1:n-1
IS(m)=H101(n-m,2)+ES(m);
end
G101(n,2)=max(IS);
end
for n=4:1:21600
for m=1:1:3
IS(m)=H101(n-m,2)+ES(m);
end
G101(n,2)=max(IS);
end
y7=G101(:,2);
Subplot(5,1,5);
plot(x,y7);
axis([0 60 -1 0.8]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure;
y8=(y3+y7)/2;
Subplot(5,1,1);
plot(x,y8);
axis([0 4 -1 0.8]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
S101=D101;
S101(:,2)=y8;
n=0;
m=0;
E101=S101;
F101=S101;
ES=[0,0.1,0.2,0.4,0.6,0.8,1,0.8,0.6,0.4,0.2,0.1,0];
IS=[5,5,5,5,5,5,5,5,5,5,5,5,5];
for n=1:1:21587
for m=1:1:13
IS(m)=F101(n+m,2)-ES(m);
end
E101(n,2)=min(IS);
end
IS=[5,5,5,5,5,5,5,5,5,5,5,5,5];
for n=21588:1:21599
for m=1:1:13-(n-21587)
IS(m)=F101(n+m,2)-ES(m);
end
E101(n,2)=min(IS);
end
y9=E101(:,2);
subplot(5,1,2);
plot(x,y9);
axis([0 4 -1 3]);
n=0;
m=0;
G101=E101;
H101=E101;
ES=[0,0.1,0.2,0.4,0.6,0.8,1,0.8,0.6,0.4,0.2,0.1,0];
IS=[-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5];
for n=2:1:13
for m=1:1:n-1
IS(m)=H101(n-m,2)+ES(m);
end
G101(n,2)=max(IS);
end
IS=[-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5];
for n=14:1:21600
for m=1:1:13
IS(m)=H101(n-m,2)+ES(m);
end
G101(n,2)=max(IS);
end
y10=G101(:,2);
Subplot(5,1,3);
plot(x,y10);
axis([0 4 -1 0.8]);
n=0;
m=0;
E101=G101;
F101=G101;
ES=[0,0.1,0.2,0.4,0.6,0.8,1,0.8,0.6,0.4,0.2,0.1,0];
IS=[-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5];
for n=2:1:13
for m=1:1:n-1
IS(m)=F101(n-m,2)+ES(m);
end
E101(n,2)=max(IS);
end
IS=[-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5];
for n=14:1:21600
for m=1:1:13
IS(m)=F101(n-m,2)+ES(m);
end
E101(n,2)=max(IS);
end
y11=E101(:,2);
subplot(5,1,4);
plot(x,y11);
axis([0 4 -1 3]);
n=0;
m=0;
G101=E101;
H101=E101;
ES=[0,0.1,0.2,0.4,0.6,0.8,1,0.8,0.6,0.4,0.2,0.1,0];
IS=[5,5,5,5,5,5,5,5,5,5,5,5,5];
for n=1:1:21587
for m=1:1:13
IS(m)=H101(n+m,2)-ES(m);
end
G101(n,2)=min(IS);
end
IS=[5,5,5,5,5,5,5,5,5,5,5,5,5];
for n=21588:1:21599
for m=1:1:13-(n-21587)
IS(m)=H101(n+m,2)-ES(m);
end
G101(n,2)=min(IS);
end
y12=G101(:,2);
Subplot(5,1,5);
plot(x,y12);
axis([0 60 -1 1]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure;
yy=y8-y12;
plot(x,yy);
axis([0 60 -1 1]);
n=0;
number1=0;
H101(:,2)=yy;
y13=yy;
y13=0;
for n=20:1:21550;
y13(n)=H101(n,2);
end
T1=0.15*max(y13);
T2=0.1*max(y13);
k=-100;
for n=25:1:21550%7201%14401%
if H101(n,2)>=T1&H101(n+1,2)>=T1&(n-k)>50
number1=number1+1;
k=n;
end%if%
end %for%
HR=number1
%Deciosion rules
figure;
subplot(4,1,1)
plot(x,y);
axis([0 20 -1 2]);
subplot(4,1,2)
plot(x,y8);
axis([0 20 -1 2]);
subplot(4,1,3)
plot(x,y12);
axis([0 20 -1 2]);
subplot(4,1,4)
plot(x,yy);
axis([0 60 -1 2]);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -