# copy of poduv.m
# read data and rearrange in columns
[r,c,N] = size(u); # 4-D is the number of files
len = r*c;
U = zeros(len*2,N); # r*c*3 length of the vector
% small rearrangement
for i = 1:N
U(1:len,i) = reshape(handles.u(:,:,i),len,1);
U(len+1:2*len,i) = reshape(handles.v(:,:,i),len,1);
end
% Ensemble average of U:
% meanU = mean(U,2);
% Uf = U;
% meanU = zeros(len,1);
% Fluctuations
% % Uf = U - repmat(meanU,1,N);
% for i = 1:N
% Uf(:,i) = U(:,i) - meanU;
% end
Uf = bsxfun(@minus,U,mean(U,2));