Documentation |
Average or mean value of fixed-point array
c = mean(a)
c = mean(a,dim)
c = mean(a) computes the mean value of the fixed-point array a along its first nonsingleton dimension.
c = mean(a,dim) computes the mean value of the fixed-point array a along dimension dim. dim must be a positive, real-valued integer with a power-of-two slope and a bias of 0.
The input to the mean function must be a real-valued fixed-point array.
The fixed-point output array c has the same numerictype properties as the fixed-point input array a. If the input, a, has a local fimath, then it is used for intermediate calculations. The output, c, is always associated with the default fimath.
When a is an empty fixed-point array (value = []), the value of the output array is zero.
Compute the mean value along the first dimension (rows) of a fixed-point array.
x = fi([0 1 2; 3 4 5], 1, 32); % x is a signed FI object with a 32-bit word length % and a best-precision fraction length of 28-bits mx1 = mean(x,1)
Compute the mean value along the second dimension (columns) of a fixed-point array.
x = fi([0 1 2; 3 4 5], 1, 32); % x is a signed FI object with a 32-bit word length % and a best-precision fraction length of 28 bits mx2 = mean(x,2)