Matlab Graph Presentation

(save text as final.m)



format short e fitcoeff=[ -5.0 fitK4(1) fitK3(1) fitK2(1) fitK1(1) fitK0(1) -4.5 fitK4(6) fitK3(6) fitK2(6) fitK1(6) fitK0(6) -4.0 fitK4(11) fitK3(11) fitK2(11) fitK1(11) fitK0(11) -3.5 fitK4(16) fitK3(16) fitK2(16) fitK1(16) fitK0(16) -3.0 fitK4(21) fitK3(21) fitK2(21) fitK1(21) fitK0(21) -2.5 fitK4(26) fitK3(26) fitK2(26) fitK1(26) fitK0(26) -2.0 fitK4(31) fitK3(31) fitK2(31) fitK1(31) fitK0(31) -1.5 fitK4(36) fitK3(36) fitK2(36) fitK1(36) fitK0(36) -1.0 fitK4(41) fitK3(41) fitK2(41) fitK1(41) fitK0(41) -0.5 fitK4(46) fitK3(46) fitK2(46) fitK1(46) fitK0(46) +0.0 fitK4(51) fitK3(51) fitK2(51) fitK1(51) fitK0(51) +0.5 fitK4(56) fitK3(56) fitK2(56) fitK1(56) fitK0(56) +1.0 fitK4(61) fitK3(61) fitK2(61) fitK1(61) fitK0(61) ]; fita13=polyval(fitcoeff(13,2:6),vp); fita12=polyval(fitcoeff(12,2:6),vp); fita11=polyval(fitcoeff(11,2:6),vp); fita10=polyval(fitcoeff(10,2:6),vp); fita9=polyval(fitcoeff(9,2:6),vp); fita8=polyval(fitcoeff(8,2:6),vp); fita7=polyval(fitcoeff(7,2:6),vp); fita6=polyval(fitcoeff(6,2:6),vp); fita5=polyval(fitcoeff(5,2:6),vp); fita4=polyval(fitcoeff(4,2:6),vp); fita3=polyval(fitcoeff(3,2:6),vp); fita2=polyval(fitcoeff(2,2:6),vp); fita1=polyval(fitcoeff(1,2:6),vp); for i=1:83 vp(i)=exp(vp(i)); end axis([0 500 -1e-3 6e-3]) plot(vp,exp(fita1),'o',xP1P0,yP1P0) grid hold plot(vp,exp(fita2),'o',xP0P5,yP0P5) plot(vp,exp(fita3),'o',xP0P0,yP0P0) plot(vp,exp(fita4),'o',xM0P5,yM0P5) plot(vp,exp(fita5),'o',xM1P0,yM1P0) plot(vp,exp(fita6),'o',xM1P5,yM1P5) plot(vp,exp(fita7),'o',xM2P0,yM2P0) plot(vp,exp(fita8),'o',xM2P5,yM2P5) plot(vp,exp(fita9),'o',xM3P0,yM3P0) plot(vp,exp(fita10),'o',xM3P5,yM3P5) plot(vp,exp(fita11),'o',xM4P0,yM4P0) plot(vp,exp(fita12),'o',xM4P5,yM4P5) plot(vp,exp(fita13),'o',xM5P0,yM5P0) for i=15:83 y(i-14,2)=0.7/vp(i); y(i-14,1)=vp(i); end plot(y(:,1),y(:,2)) title('RCA 12ax7 Final Interpolation') ylabel('plate current (mA)') xlabel('plate voltage (V)') pause hold axis([0 500 0 4e-3]) plot(vp,exp(fita13)) grid hold plot(vp,exp(fita12)) plot(vp,exp(fita11)) plot(vp,exp(fita10)) plot(vp,exp(fita9)) plot(vp,exp(fita8)) plot(vp,exp(fita7)) plot(vp,exp(fita6)) plot(vp,exp(fita5)) plot(vp,exp(fita4)) plot(vp,exp(fita3)) plot(vp,exp(fita2)) plot(vp,exp(fita1)) for i=15:83 y(i-14,2)=0.7/vp(i); y(i-14,1)=vp(i); end plot(y(:,1),y(:,2)) title('RCA 12ax7 Final Interpolation') ylabel('plate current (mA)') xlabel('plate voltage (V)') pause(1) hold axis([0 500 0 4e-3]) plot(dataP1P0_SPICE(1,:),dataP1P0_SPICE(2,:),'ob',xP1P0,yP1P0) grid hold plot(dataP0P5_SPICE(1,:),dataP0P5_SPICE(2,:),'ob',xP0P5,yP0P5) plot(dataP0P0_SPICE(1,:),dataP0P0_SPICE(2,:),'ob',xP0P0,yP0P0) plot(dataM0P5_SPICE(1,:),dataM0P5_SPICE(2,:),'ob',xM0P5,yM0P5) plot(dataM1P0_SPICE(1,:),dataM1P0_SPICE(2,:),'ob',xM1P0,yM1P0) plot(dataM1P5_SPICE(1,:),dataM1P5_SPICE(2,:),'ob',xM1P5,yM1P5) plot(dataM2P0_SPICE(1,:),dataM2P0_SPICE(2,:),'ob',xM2P0,yM2P0) plot(dataM2P5_SPICE(1,:),dataM2P5_SPICE(2,:),'ob',xM2P5,yM2P5) plot(dataM3P0_SPICE(1,:),dataM3P0_SPICE(2,:),'ob',xM3P0,yM3P0) plot(dataM3P5_SPICE(1,:),dataM3P5_SPICE(2,:),'ob',xM3P5,yM3P5) plot(dataM4P0_SPICE(1,:),dataM4P0_SPICE(2,:),'ob',xM4P0,yM4P0) plot(dataM4P5_SPICE(1,:),dataM4P5_SPICE(2,:),'ob',xM4P5,yM4P5) plot(dataM5P0_SPICE(1,:),dataM5P0_SPICE(2,:),'ob',xM5P0,yM5P0) for i=15:83 y(i-14,2)=0.7/vp(i); y(i-14,1)=vp(i); end plot(y(:,1),y(:,2)) title('RCA 12ax7 Spice Output Against Original Data') ylabel('plate current (mA)') xlabel('plate voltage (V)') pause

~:( HOME :)~

viva Analog /// jc -> lynx.net