y=nt_fold(x) - unfold 3D to 2D y: 2D matrix of concatentated data (time * channel) x: 3D matrix of (time * channel * trial) NoiseTools
0001 function x=nt_unfold(x) 0002 %y=nt_fold(x) - unfold 3D to 2D 0003 % 0004 % y: 2D matrix of concatentated data (time * channel) 0005 % 0006 % x: 3D matrix of (time * channel * trial) 0007 % 0008 % NoiseTools 0009 0010 %nt_greetings; 0011 0012 0013 if isempty(x) 0014 x=[]; 0015 else 0016 [m,n,p]=size(x); 0017 if p>1; 0018 x=reshape(permute(x,[1 3 2]), m*p,n); 0019 else 0020 x=x; 0021 end 0022 end