Skip to content

frequency

Frequency distribution (counts in bins).

v = frequency(data_array, bins_array)

Counts how many values in data_array fall into each bin defined by bins_array. Returns a vertical array of length length(bins_array) + 1 — bin i counts values <= bins_array(i) not in earlier bins; the final extra bin counts values greater than the last bin edge.

frequency([1 2 3 4 5 6 7 8 9 10], [3 6 9])
% [3; 3; 3; 1] (≤3, 4–6, 7–9, >9)
  • countif — Count cells in a range that meet a criterion.
  • histogram — Histogram of data.