detrendJo.m 415 B

123456789101112131415
  1. function [outData] = detrendJo(inData,nTrials)
  2. %DETRENDJO detrend function adapted to ABR data-structure
  3. % basically the default detrend function of Matlab but adapted to the
  4. % structure of ABR data
  5. % divide input data into trials
  6. inData = reshape(inData,[],nTrials);
  7. % perform detrending
  8. outData = detrend(inData);
  9. % restore original shape of input data
  10. outData = reshape(outData,[],1);
  11. end