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 nt_greetings; 0010 0011 0012 if isempty(x) 0013 x=[]; 0014 else 0015 [m,n,p]=size(x); 0016 if p>1; 0017 x=reshape(permute(x,[1 3 2]), m*p,n); 0018 else 0019 x=x; 0020 end 0021 end