I have tried vectorization with bsxfun(), but could not get the code working. I also tried meshgrid() but it requires too much memory. The data line isn't code and is just the dimensions for clarity.
data = 25x1536x2048[Nt, Nv, Nh] = size(data);MUvh = reshape(mean(data,1), [Nv Nh]);for ii = 1:Nv for jj = 1:Nh data(:,ii,jj) = data(:,ii,jj) - MUvh(ii,jj); endend
Best Answer