title: Calculate Median Image in Matlab
body: <p>I am new to matlab, so forgive me if i am asking for the obvious here: what i have is a collection of color photographic images (all the same dimensions). What i want to do is calculate the <a href="https://en.wikipedia.org/wiki/Median" rel="nofollow">median</a> color value for each pixel.</p>
  
  <p>I know there is a median filter in matlab, but as far as i know it does not do exactly what i want. Because i want to calculate the median value between the entire collection of images, for each separate pixel.</p>
  
  <p>So for example, if i have three images, i want matlab to calculate (for each pixel) which colorvalue out of those three images is the median value. How would i go about doing this, does anyone know?</p>
  
  <hr>
  
  <p><em>Edit: From what i can come up with, i would have to load all the images into a single matrix. The matrix would have to have 4 dimensions (height, width, rgb, images), and for each pixel and each color find the median in the 4th dimension (between the images).
  Is that correct (and possible)? And how can i do this?</em></p>