interp.html m]j M@8" M JJ m\ mbD lX v M@ mTEXTttxt 2 interp.html

Matlab Interpolation Routines

(save text as interp.m)



clear format short e data12ax7 s=size(dataP1P0); t=s(2); for i=1:t P1P0(1,i)=log(dataP1P0(1,i)); P1P0(2,i)=log(dataP1P0(2,i)); end s=size(dataP0P5); t=s(2); for i=1:t P0P5(1,i)=log(dataP0P5(1,i)); P0P5(2,i)=log(dataP0P5(2,i)); end s=size(dataP0P0); t=s(2); for i=1:t P0P0(1,i)=log(dataP0P0(1,i)); P0P0(2,i)=log(dataP0P0(2,i)); end s=size(dataM0P5); t=s(2); for i=1:t M0P5(1,i)=log(dataM0P5(1,i)); M0P5(2,i)=log(dataM0P5(2,i)); end s=size(dataM1P0); t=s(2); for i=1:t M1P0(1,i)=log(dataM1P0(1,i)); M1P0(2,i)=log(dataM1P0(2,i)); end s=size(dataM1P5); t=s(2); for i=1:t M1P5(1,i)=log(dataM1P5(1,i)); M1P5(2,i)=log(dataM1P5(2,i)); end s=size(dataM2P0); t=s(2); for i=1:t M2P0(1,i)=log(dataM2P0(1,i)); M2P0(2,i)=log(dataM2P0(2,i)); end s=size(dataM2P5); t=s(2); for i=1:t M2P5(1,i)=log(dataM2P5(1,i)); M2P5(2,i)=log(dataM2P5(2,i)); end s=size(dataM3P0); t=s(2); for i=1:t M3P0(1,i)=log(dataM3P0(1,i)); M3P0(2,i)=log(dataM3P0(2,i)); end s=size(dataM3P5); t=s(2); for i=1:t M3P5(1,i)=log(dataM3P5(1,i)); M3P5(2,i)=log(dataM3P5(2,i)); end s=size(dataM4P0); t=s(2); for i=1:t M4P0(1,i)=log(dataM4P0(1,i)); M4P0(2,i)=log(dataM4P0(2,i)); end s=size(dataM4P5); t=s(2); for i=1:t M4P5(1,i)=log(dataM4P5(1,i)); M4P5(2,i)=log(dataM4P5(2,i)); end s=size(dataM5P0); t=s(2); for i=1:t M5P0(1,i)=log(dataM5P0(1,i)); M5P0(2,i)=log(dataM5P0(2,i)); end axis([-3 6 -90 -5]) plot((P1P0(1,:)),(P1P0(2,:)),'--') hold grid plot((P0P5(1,:)),(P0P5(2,:)),'--') plot((P0P0(1,:)),(P0P0(2,:)),'--') plot((M0P5(1,:)),(M0P5(2,:)),'--') plot((M1P0(1,:)),(M1P0(2,:)),'--') plot((M1P5(1,:)),(M1P5(2,:)),'--') plot((M2P0(1,:)),(M2P0(2,:)),'--') plot((M2P5(1,:)),(M2P5(2,:)),'--') plot((M3P0(1,:)),(M3P0(2,:)),'--') plot((M3P5(1,:)),(M3P5(2,:)),'--') plot((M4P0(1,:)),(M4P0(2,:)),'--') plot((M4P5(1,:)),(M4P5(2,:)),'--') plot((M5P0(1,:)),(M5P0(2,:)),'--') title('RCA 12ax7 Data (LogLog Domain)') ylabel('log(Ip)') xlabel('log(Vpc)') %text(4.2,-1,'Vgc = -1.0v') pause(1) CP1P0=polyfit(P1P0(1,:),P1P0(2,:),4) CP0P5=polyfit(P0P5(1,:),P0P5(2,:),4) CP0P0=polyfit(P0P0(1,:),P0P0(2,:),4) CM0P5=polyfit(M0P5(1,:),M0P5(2,:),4) CM1P0=polyfit(M1P0(1,:),M1P0(2,:),4) CM1P5=polyfit(M1P5(1,:),M1P5(2,:),4) CM2P0=polyfit(M2P0(1,:),M2P0(2,:),4) CM2P5=polyfit(M2P5(1,:),M2P5(2,:),4) CM3P0=polyfit(M3P0(1,:),M3P0(2,:),4) CM3P5=polyfit(M3P5(1,:),M3P5(2,:),4) CM4P0=polyfit(M4P0(1,:),M4P0(2,:),4) CM4P5=polyfit(M4P5(1,:),M4P5(2,:),4) CM5P0=polyfit(M5P0(1,:),M5P0(2,:),4) pause(1) vp=-2.0:0.1:6.2; fitP1P0=polyval(CP1P0,vp); plot(vp,fitP1P0,'*') fitP0P5=polyval(CP0P5,vp); plot(vp,fitP0P5,'*') fitP0P0=polyval(CP0P0,vp); plot(vp,fitP0P0,'*') fitM0P5=polyval(CM0P5,vp); plot(vp,fitM0P5,'*') fitM1P0=polyval(CM1P0,vp); plot(vp,fitM1P0,'*') fitM1P5=polyval(CM1P5,vp); plot(vp,fitM1P5,'*') fitM2P0=polyval(CM2P0,vp); plot(vp,fitM2P0,'*') fitM2P5=polyval(CM2P5,vp); plot(vp,fitM2P5,'*') fitM3P0=polyval(CM3P0,vp); plot(vp,fitM3P0,'*') fitM3P5=polyval(CM3P5,vp); plot(vp,fitM3P5,'*') fitM4P0=polyval(CM4P0,vp); plot(vp,fitM4P0,'*') fitM4P5=polyval(CM4P5,vp); plot(vp,fitM4P5,'*') fitM5P0=polyval(CM5P0,vp); plot(vp,fitM5P0,'*') pause hold for i=1:83 xP1P0(i)=exp(vp(i)); yP1P0(i)=exp(fitP1P0(i)); end for i=1:83 xP0P5(i)=exp(vp(i)); yP0P5(i)=exp(fitP0P5(i)); end for i=1:83 xP0P0(i)=exp(vp(i)); yP0P0(i)=exp(fitP0P0(i)); end for i=1:83 xM0P5(i)=exp(vp(i)); yM0P5(i)=exp(fitM0P5(i)); end for i=1:83 xM1P0(i)=exp(vp(i)); yM1P0(i)=exp(fitM1P0(i)); end for i=1:83 xM1P5(i)=exp(vp(i)); yM1P5(i)=exp(fitM1P5(i)); end for i=1:83 xM2P0(i)=exp(vp(i)); yM2P0(i)=exp(fitM2P0(i)); end for i=1:83 xM2P5(i)=exp(vp(i)); yM2P5(i)=exp(fitM2P5(i)); end for i=1:83 xM3P0(i)=exp(vp(i)); yM3P0(i)=exp(fitM3P0(i)); end for i=1:83 xM3P5(i)=exp(vp(i)); yM3P5(i)=exp(fitM3P5(i)); end for i=1:83 xM4P0(i)=exp(vp(i)); yM4P0(i)=exp(fitM4P0(i)); end for i=1:83 xM4P5(i)=exp(vp(i)); yM4P5(i)=exp(fitM4P5(i)); end for i=1:83 xM5P0(i)=exp(vp(i)); yM5P0(i)=exp(fitM5P0(i)); end axis([0 500 0 4e-3]) plot(xP1P0,yP1P0,'--') hold grid plot(xP0P5,yP0P5,'--') plot(xP0P0,yP0P0,'--') plot(xM0P5,yM0P5,'--') plot(xM1P0,yM1P0,'--') plot(xM1P5,yM1P5,'--') plot(xM2P0,yM2P0,'--') plot(xM2P5,yM2P5,'--') plot(xM3P0,yM3P0,'--') plot(xM3P5,yM3P5,'--') plot(xM4P0,yM4P0,'--') plot(xM4P5,yM4P5,'--') plot(xM5P0,yM5P0,'--') plot(dataP1P0(1,:),dataP1P0(2,:),'ob') plot(dataP0P5(1,:),dataP0P5(2,:),'ob') plot(dataP0P0(1,:),dataP0P0(2,:),'ob') plot(dataM0P5(1,:),dataM0P5(2,:),'ob') plot(dataM1P0(1,:),dataM1P0(2,:),'ob') plot(dataM1P5(1,:),dataM1P5(2,:),'ob') plot(dataM2P0(1,:),dataM2P0(2,:),'ob') plot(dataM2P5(1,:),dataM2P5(2,:),'ob') plot(dataM3P0(1,:),dataM3P0(2,:),'ob') plot(dataM3P5(1,:),dataM3P5(2,:),'ob') plot(dataM4P0(1,:),dataM4P0(2,:),'ob') plot(dataM4P5(1,:),dataM4P5(2,:),'ob') plot(dataM5P0(1,:),dataM5P0(2,:),'ob') title('RCA 12ax7 Data Interpolation') ylabel('Ip (mA)') xlabel('Vpc (volts)') for i=1:500 yy(i,1)=i; yy(i,2)=0.7/i; end plot(yy(:,1),yy(:,2)) pause hold

jc@lynx.bc.ca


jj2 maillet_HD interp.htmlTEXTttxt TEXTttxt 22 h2alis 8y;5/ls(dTf     jj2,L2styl ,O