Quantcast
Viewing all articles
Browse latest Browse all 12262

Re: histogram

Just one question .what is that mk_histo(L,N,20) ?

Just as I wrote before - I don't think that the built-in functions can do what you want. A small self written routine is necessary. Thats what mk_histo (aka make histogram) is - a routine I wrote to do what I thought you needed. Here is the file.

First parameter (v) of the routine ist a vector with the values you want to categorize your data for. Its the particle length in your problem (I had "values" in mind, so the v). The second parameter is a corresponding vector with the number of particles ("count" --> c). v and c must be vectors of same dimension - its a quick hack and so there is no error checking built in. The third parameter "n" is the number of intervals you want your data sorted in. The range [min(v); max(v)] is divided in n intervals of equal length. With exception of the first interval the lower end of each interval counts for the preceding interval, so it counts all occurencies of lower<value<=upper.

The output of the routine is a n x 2 matrix.The first column contains the midpoints of the intervals. The second column represents the frequencies with which values in data fall into the intervals.

In contrast to histogram() "n" must be an integer (in histogram() and hist() it could also be a vector with interval endpoints).


Viewing all articles
Browse latest Browse all 12262

Trending Articles