clear %fid=fopen('c:\data\test.txt','r'); fid=fopen('c:\data\knorr\serial\1\20060124133800MotionPak-Bow.txt','r'); d=fread(fid,inf,'uint8')'; fclose(fid) % remove the VB time stamp tbeg=strfind(char(d),'Time'); for i=1:length(tbeg) d(tbeg(i):tbeg(i)+28)='%'; end d=d(d~='%'); npts=3; % change to 4 to see first byte shift e=d(2:2:npts*7*2); o=d(1:2:npts*7*2); counts=256*o+e; nscans=floor(length(counts)/7); volts=reshape(counts(1:nscans*7),[7 nscans])'*5/4095; acc=(volts(:,[4 3 2])-2.5)/1.2*9.8; rate=(volts(:,[7 6 5])-2.5)/.027; Tmp2=volts(:,1)*100-273.15; subplot(311);plot(acc); subplot(312);plot(rate); subplot(313);plot(Tmp2);