modeMode
The mode of given elements is defined as the element having the highest frequency of occurrence. If there are different elements having same frequencies, the smallest element will be returned. (For complex numbers, the element with the smallest modulus will be return.)
m = mode(A)[m,freq] = mode(A)A is a scalar, m is A and freq is 1.A is a vector, m contains the mode of A along the longer dimension. The optional output freq contains the frequencies of occurrences.A is a matrix or multi-dimensional array, m contains modes of vectors of A along the first non-singleton dimension. The optional output freq contains the frequencies of occurrences.NaN values in A are ignored when finding the modes.A is an empty array, the outputs m and freq are both empty.NaN, the outputs m and freq will be NaN and 0, respectively.m = mode(A, k)[m,freq] = mode(A, k)m = mode(A) and [m,freq] = mode(A) above, except that m contains modes of vectors along the k-th dimension.k should be a real integer scalar