There is a dataset (just for test) as follow: 0.1 0.2 0.3 0.4 0.5 1.1 1.2 1.3 1.4 1.5 0.1 0.2 0.3 0.4 0.5 I'd like to get the frequency count between the minimum 0.1 and maximum 1.5 with the bin(step size) is 0.1. I have tested in Matlab, Octave, Origin, and AWK script. However, I got completely different result.
1. Matlab
data = [0.1 0.2 0.3 0.4 0.5 1.1 1.2 1.3 1.4 1.5 0.1 0.2 0.3 0.4 0.5];
edge = 0.1:0.1:1.5;
count = histc(data, edge);
result is:
count = [2 4 0 2 2 0 0 0 0 0 1 1 1 1 1]
2. Octave
data = [0.1 0.2 0.3 0.4 0.5 1.1 1.2 1.3 1.4 1.5 0.1 0.2 0.3 0.4 0.5];
edge = 0.1:0.1:1.5;
count = histc(data, edge);
result is:
count = [2 2 2 2 2 0 0 0 0 0 1 2 0 1 1]
3. Origin
use the command "frequency count", set the min=0.1
, max=1.5
, step size=0.1.
result is:
count = [2 4 0 2 2 0 0 0 0 0 2 1 1 1]
4. AWK
{...;count[data/0.1]++;} ...
result is:
count = [2 4 0 2 2 0 0 0 0 0 2 0 2 0 1]
Why do I get these different results? Am I doing something wrong, or have I misunderstood the concept of "frequency count"? I don't think any of the above results are correct... Could you please tell me what should I do?
2 4 0 2 2 0 0 0 0 0 2 1 1 0 1
. – Paul R