riya has asked for the wisdom of the Perl Monks concerning the following question:

Hi, How to create a rectangular matrix n*m(1300*1100)

Replies are listed 'Best First'.
Re: creating a matrix
by BioLion (Curate) on Nov 20, 2009 at 10:30 UTC

    You want an array of arrays - see perldsc :

    use strict; use warnings; # not use warngings; my $aoa = []; ## 4 x 4 matrix for my $x ( 0 .. 3 ){ for my $y ( 0.. 3){ $aoa->[$x]->[$y] = "this is a cell!"; } }

    HTH!

    Just a something something...
Re: creating a matrix
by dHarry (Abbot) on Nov 20, 2009 at 11:18 UTC
Re: creating a matrix
by zentara (Cardinal) on Nov 20, 2009 at 13:56 UTC
    ...depending on what calculations you intend to do with your matrix, you might want to use PDL and create piddles..... it is much faster than standard Perl math

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku