FUNCTION REFERENCE
medfilt2
2-D median filtering.
2-D median filtering.
Syntax
B = medfilt2(A)Syntax
B = medfilt2(A, [m n], padopt)Each output is the median of the m-by-n neighbourhood (default 3-by-3) centred at floor(([m n]+1)/2). padopt: 'zeros' (default), 'symmetric' (mirror) or 'indexed' (1 for double images, 0 otherwise). For an even number of elements the median is the mean of the two middle values; integer classes discard the fraction, as the reference page states (its example gives 4 for [1 5; 4 8]). The class is kept.
Example
medfilt2([1 9 3; 4 5 6; 7 8 2]) % [0 3 0; 4 5 3; 0 4 0]Example
medfilt2(uint8([1 5; 4 8]), [2 2]) % uint8 [4 2; 2 0]Differences from MATLAB: only 2-D images; NaN values sort after every number.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.