function cubemedian

Does a median of all images in X. The value reject can be used to exclude a value to be taken when calculating the median.

result = cubemedian(X [, reject])

X:   A matrix or a FITS file name. If a FITS file name is given, the global variable tmpmem determines how many bytes of data are read in at a time.
reject:   Optional, a value which should be discarded.

See also
function collapse

If reject is given and no pixel along the cube is different from reject, a value of 0 will be inserted.