0001 function outchdr = remove_tspecs_v(chdr,cell,trial)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 ses_hdr_offsets_v;
0015
0016 if ~(nargin==3 & nargout==1)
0017 error('Function get_tspecs_v requires 3 input and 1 output arguments.');
0018 end
0019
0020 if cell > size(chdr,1)
0021 error(['Cell argument must be no greater than ' int2str(size(chdr,1))]);
0022 end
0023
0024 if trial > chdr(cell,NTrials)
0025 error(['Trial argument must be no greater than ' int2str(chdr(cell,NTrials))]);
0026 end
0027
0028 outchdr=zeros(size(chdr));
0029 outchdr=chdr;
0030 numspecs=floor(chdr(cell,LSpec)/2);
0031 tspec_offset = 6+((trial-1)*numspecs);
0032 mask=ones(1,size(chdr,2));
0033 mask(tspec_offset:(tspec_offset+numspecs-1))=zeros(1,size([tspec_offset:(tspec_offset+numspecs-1)],2));
0034 outchdr(cell,1:size(outchdr,2))=zeros(1,size(outchdr,2));
0035 outchdr(cell,1:size(find(mask),2))=chdr(cell,mask);
0036 outchdr(cell,NTrials)=chdr(cell,NTrials)-1;