I have a 3D array (S) of size 75x31253x1523. If I was to calculate the median along the second axis (for each row) it would be median(S,2) which would result in a 75x1x1523 array.
However, because the array is large, I run out of memory when I try to calculate the median of the whole array with one line. Therefore, I want to calculate the median in chunks. The problem is that each chunk will be of size Ax1xB. When stacking them together, they will be of size AxNxB. How can I calculate it in chunks and still end with size Ax1xB (75x1x1523)?