Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

histogram

  • To: mathgroup at smc.vnet.net
  • Subject: [mg2058] histogram
  • From: michael.probst at uibk.ac.at (Michael Probst)
  • Date: Sat, 23 Sep 1995 20:33:29 -0400
  • Organization: University of Innsbruck, Austria

Hi !
I have a rather simple mma - question:
What is the best (fastest) way to generate histograms ?
That is: I have a list of data and I want to fill the data
into another list which elements are zero at the beginning
and are incramanted by one if the data is in the interval 
corresponding to the respective element of the second list
which is just the histogram.
I can use a Do[] but this seems clumsy:
hist={0,0,0, .... };
Do[
  ind=myindexfunction[data[[i]]]; hist[[ind]]=hist[[ind]]+1,
{i,1,Length[data]}]

Thanks a lot !
Michael

michael.probst at uibk.ac.at



  • Prev by Date: Proof Generator using Rules of Inference
  • Next by Date: Help about the Fourier transform command
  • Previous by thread: Re: Proof Generator using Rules of Inference
  • Next by thread: Re: histogram