How do you bin data by a certain value? and count the values in each bin?

1 view (last 30 days)
How do you bin data by a certain value? For example I have 1 column of data that consists of numbers that represent time in seconds. I would like to bin the data by 500ms, therefore .5. (I attached the dataset I'm working with)
I've attached the dataset I'm working with here.
An example would be:
  • First bin: 0 thru 0.5 --> 1 counts
  • Second bin: .05 thru 1 --> 4 counts

Answers (1)

the cyclist
the cyclist on 16 May 2018
Use the histcounts command.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!