The way that IMRESIZE implements interpolation is by calculating for each pixel in the output image (inverse mapping), the indices of the pixels in the input image that are going to be involved in the interpolation, along with the contributing weights.
The neighborhood and the weights are determined by the type of the interpolation kernel used, which as @Albert points out, can be passed along to the IMRESIZE function (the 'Method' property can accept {f,w}
a cell array with the kernel function and the kernel width)
These two components will be used to compute linear combination of the input pixels involved to fill each value of the output pixels. This process is performed along each dimension separately one-at-a-time (vertically then horizontally).
Now the problem for you is that you can never obtain the median value by using a linear combination, that's because median is a non-linear ordering filter. So your only option is to write your own implementation...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…