Creates bins for probability density functions. |
||
Syntax |
x = Bins(v,n) |
|
Arguments |
Name |
Description |
v |
A vector used to create the bins. |
|
n |
A positive integer representing the number of bins. |
|
Output |
Name |
Description |
x |
A vector of the mid-points of the bins. Its length is equal to the number of bins (n). |
|
Example |
Create 5 bins covering the range from zero to 100. |
|
Syntax |
||
x = Bins([0:100],5) |
||
Result |
||
x = 10 30 50 70 90 |
||
Comments |
The Bins function returns the x vector for creating a probability density plot, based on the given values and the number of bins. The resultant vector has a number of elements equal to the number of bins. The elements of the result are the midpoints of each bin. The bins are created by taking the range (max - min) of the values vector and dividing it into n sections. The upper boundary of each bin is also the lower boundary for the next bin. The lower boundary for the first bin is the minimum value of the range. The final upper boundary is the maximum value of the range. |
|
See Also: |