On Thu, 2006-20-04 at 20:55 -0600, The Other1 wrote:
> My question is how to walk through the array grabbing column 1 of four rows, 
> pass those values to the Average function (or if there is a beter way, I am 
> open to it!), store the average to be used by GD later, then do the next 
> column, etc, up to column 6, then move on to next 4 rows.  Any help is much 
> appreciated!  Thanx!

The is a subroutine in Math::Matrix available on CPAN
http://search.cpan.org/ called transpose() that you could use. If not:

for my $col ( 0 .. 5 ){
  my @a = ();
  for my $row ( 0 .. 3 ){
    push @a, $array[$row][$col];
  }
  my $average = Average( @a );
}

BTW, a convention in Perl is that all subroutine and methods are in
lowercase with underscores separating words.

-- 
__END__

Just my 0.00000002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to