Assuming line 64 is
$lnPAM1[$i][$j]= ($lnPAM1[$i][$j]) /($mutrate*100);, you could try troubleshooting with something like this on the line before:
say "$lnPAM1[$i][$j]:$i:$j";
When I do this I see something like this snippet:
-3.91202300542815:3:7
-3.50655789731998:3:8
:3:9
:3:10
:3:11
:3:12
:3:13
:3:14
:3:15
:3:16
:3:17
:3:18
:3:19
-4.60517018598809:4:0
:4:1
:4:2
:4:3
Taking a look at where the matrix is built, it seems that the problem stems from your use of next in:
LINE: for (my $i=0; $i<20; $i++){
for (my $j=0; $j<20; $j++){
if ($matrix[$i][$j] > 0){
$lnPAM1[$i][$j] = log $matrix[$i][$j];
}else{ next LINE;
}
}
}
By using next, you don't use all 20 iterations of i or j when building the matrix, but you do later on. You could look to see the dimensions of the matrix before iterating through its dimensions.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.