function [outData] = detrendJo(inData,nTrials) %DETRENDJO detrend function adapted to ABR data-structure % basically the default detrend function of Matlab but adapted to the % structure of ABR data % divide input data into trials inData = reshape(inData,[],nTrials); % perform detrending outData = detrend(inData); % restore original shape of input data outData = reshape(outData,[],1); end