
Laurent_R
Veteran
/ Moderator
Jul 27, 2013, 5:31 AM
Post #3 of 6
(2658 views)
|
Re: [ptahotep] Finding peaks from a serie of numbers (histogram)
[In reply to]
|
Can't Post
|
|
If I understand well, all the values on the second column form an histogram that you want to go through to sind some properties, and then the same for the third column, etc. I think you should "transpose" your data into an array of 6 arrays, so that you end up with one of the inner array containing just the list of values of one histogram, etc. Assuming $line contains one data line from your file at a time, it could just be something like this (not tested):
chomp $line; my ($hist_index, @temp_array) = split / /, $line; for my $i (1..6) { $AoA[$i][$hist_index] = $temp_array[$i]; } You end up with an array of six arrays, one per histogram, each containing the values of the current histogram. Please note that arrays usually start with subscript 0, but, given the look of your data, I made them start at subscript 1, as I think if might easier for you to use them this way.
|