0001 function tsmat = tspecmat_from_chdr(chdr)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 ses_hdr_offsets_v;
0017
0018 ncells = size(chdr,1);
0019
0020 ntrials = chdr(:,NTrials);
0021 nspec = chdr(:,LSpec)/2;
0022
0023 max_nspec = max(nspec);
0024
0025 tsmat = [];
0026
0027 for icell = 1:ncells
0028 tmp = reshape(chdr(icell,TSpecs:(TSpecs+max_nspec*ntrials(icell)-1)),max_nspec,ntrials(icell))';
0029
0030 tsmat = [tsmat; ones(ntrials(icell),1)*icell (1:ntrials(icell))' tmp];
0031 end