frequency of a range of data from a matrix

4 views (last 30 days)
Debanjan Maity
Debanjan Maity on 15 Oct 2018
Answered: Bruno Luong on 15 Oct 2018
Say my matrix is following:
0, 1.2;
2, 2.4;
6, 1.7;
8, 1.9;
5, 2.8;
10, 3.1;
4, 5.2;
12, 5.5;
3, 4.2;
15, 4.4;
I want to get the frequency of a range of dataset. Like for range of 0-3 for the first column and for the range of 1-2 for the 2nd column i will get the result as 1.
  3 Comments
dpb
dpb on 15 Oct 2018
Why isn't result for range [1-2] --> 3 for column 2? (1.2,1.7,1.9 all >=1 and <=2)?
Debanjan Maity
Debanjan Maity on 15 Oct 2018
Frequency means the no of times the data will fall in that specified range. Like in the 1st column i am giving range of 0-3. So there are 3 values in that range. But at the same time for the 2nd column i am giving range of 1-2. so in the 2nd column there is only 1 value in that range corresponding to the range specified in the 1st column. So, the result should come as 1. Basically the output should satisfy both the ranges specified for the columns altogether.

Sign in to comment.

Answers (1)

Bruno Luong
Bruno Luong on 15 Oct 2018
use
histcounts2

Categories

Find more on Data Distribution Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!