cutblockTrial.m 446 B

1234567891011
  1. %% Function: cut data into blocks, based on trial-triggers
  2. function [blocks] = cutblockTrial(data,trigs_all,blocklen,nBlck)
  3. nTrials = size(trigs_all,3);
  4. pSmpl = blocklen/nTrials;
  5. blocks = zeros(blocklen,nBlck);
  6. for b = 1:nBlck
  7. for s = 0:nTrials-1
  8. blocks(s*pSmpl+1:s*pSmpl+pSmpl,b) = data(trigs_all(1,b,s+1):trigs_all(1,b,s+1)+pSmpl-1); % cut block at each trigger point, creating "s" sections of pSmpl per block
  9. end
  10. end