function deref_u = deref(u, reflrange)
% deref_u = deref(u, reflrange)
% dereference a velocity matrix of size (Nbins x Ntimes)

if (length(reflrange) > 1)
   refu = mstdgap(u([reflrange(1):reflrange(2)],:));
else
   refu = u(reflrange,:);
end


deref_u = u - ones(length(u(:,1)),1)*refu;



