Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Need Help! with histogram

Author
Message
Brac24
12
Years of Service
User Offline
Joined: 20th Nov 2011
Location:
Posted: 21st Nov 2011 06:45
I am reading from a file of 1000 doubles and looping through a data array to read through all the numbers in the file

I\'ve created another array of 50 elements called histogram[50].

What i cannot figure out is how to count how many values in the data[] array fall into the different bins.

so the first bin will keep track of values between 0 and 1 in the data array and the second bin will keep track of numbers from 1 to 2 and so on.
please help!!
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 21st Nov 2011 16:07
Simple division will work:



A datapoint_value of 0 or 1 will fall in bin 0, a value of 2 or 3 will fall into bin 1 etc...


JTK

Login to post a reply

Server time is: 2024-04-23 23:49:00
Your offset time is: 2024-04-23 23:49:00