You are on page 1of 3

clc;clear all; close all; count=1; Pwave=input('enter the amplitude P peak ?') Qwave=input('enter the amplitude Q peak ?

') Rwave=input('enter the amplitude R peak ?') Swave=input('enter the amplitude S peak ?') Twave=input('enter the amplitude T peak ?') %delay for starting of P wave for i=0:1.5:10 ecgsig(count)=0; count=count+1; end %amplitude for starting of P wave for i=0:0.4:3.14 ecgsig(count)=Pwave*sin(i);0.08*sin(i); count=count+1; end for i=0:2:10 ecgsig(count)=0; count=count+1; end %amplitude for starting of Q wave for i=0.2:2:3.14 ecgsig(count)=Qwave*sin(i);%-0.02*sin(i); count=count+1; end %amplitude for starting of R wave for i=-0.02:0.80:3.14 ecgsig(count)=Rwave*sin(i);%0.53*sin(i); count=count+1; end %amplitude for starting of S wave for i=-0.0:1.5:3.14 ecgsig(count)=Swave*sin(i);%1.5*sin(i); count=count+1; end for i=0:1.5:10 ecgsig(count)=0; count=count+1; end %amplitude for starting of T wave for i=0:0.4:3.14 ecgsig(count)=Twave*sin(i);%0.12*sin(i); count=count+1; end for i=0:1:10 ecgsig(count)=0; count=count+1; end plot(ecgsig); Xlabel('time in msec'); Ylabel('amplitude in mv'); axis([0,55,3,3]); grid

clc;clear all; close all; count=1; Pwave=input('enter the amplitude P peak ?') Qwave=input('enter the amplitude Q peak ?') Rwave=input('enter the amplitude R peak ?') Swave=input('enter the amplitude S peak ?') Twave=input('enter the amplitude T peak ?') %delay for starting of P wave for i=0:1.5:10 ecgsig(count)=0; count=count+1; end %amplitude for starting of P wave for i=0:0.4:3.14 ecgsig(count)=Pwave*sin(i);0.08*sin(i); count=count+1; end for i=0:0.83:10 ecgsig(count)=0; count=count+1; end %amplitude for starting of Q wave for i=0.2:2:3.14 ecgsig(count)=Qwave*sin(i);%-0.02*sin(i); count=count+1; end %amplitude for starting of R wave for i=-0.02:0.80:3.14 ecgsig(count)=Rwave*sin(i);%0.53*sin(i); count=count+1; end %amplitude for starting of S wave for i=-0.0:1.5:3.14 ecgsig(count)=Swave*sin(i);%1.5*sin(i); count=count+1; end for i=0:1.5:10 ecgsig(count)=0; count=count+1; end %amplitude for starting of T wave for i=0:0.4:3.14 ecgsig(count)=Twave*sin(i);%0.12*sin(i); count=count+1; end for i=0:1:10 ecgsig(count)=0; count=count+1; end plot(ecgsig); Xlabel('time in msec'); Ylabel('amplitude in mv'); axis([0,70,3,3]);

grid

You might also like