bins

Divides the range of data d into n equal bins.

Syntax

b = bins(d ,n)

Inputs

d
Data to be divided.
Type: double | integer
Dimension: scalar | vector | matrix
n
Number of bins to be divided into.
Type: double | integer
Dimension: scalar

Outputs

b
Resulting bins (vector b contains the center of the bins).

Example

Simple bins example.

v = [0:10:100]
n = 4
x = bins(v,n)
v = [Matrix] 1 x 11
  0   10   20   30   40   50   60   70   80   90  100
n = 4
x = [Matrix] 1 x 4
12.50000  37.50000  62.50000  87.50000