%% Median of 8-Bit Integer Array
% Define a 1-by-4 vector of 8-bit integers.

A = int8(1:4)

%
% Compute the median value.

M = median(A),
class(M)

% M is the mean of the middle two numbers in sorted order returned as an 8-bit integer.
% Copyright 2012 The MathWorks, Inc.