labRead: Read a lab file
0001 function segment=labRead(labFile) 0002 % labRead: Read a lab file 0003 0004 % Roger Jang, 20061122 0005 0006 if nargin<1, selfdemo; return; end 0007 0008 %[start, stop, label] = textread(labFile, '%d%d%s'); % This causes overflow! 0009 [start, stop, label] = textread(labFile, '%f%f%s'); 0010 segmentNum=length(start); 0011 for i=1:segmentNum 0012 segment(i).start=start(i); 0013 segment(i).stop=stop(i); 0014 segment(i).label=label{i}; 0015 end 0016 0017 % ====== Self demo 0018 function selfdemo 0019 labFile='test.lab'; 0020 segment=labRead(labFile)