Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warinings;
    ...
        $m->range(ndcoords($m(1:,1:)), 2)->reorder(2, 3, 0, 1)
            ->clump(2)->sumover;
    }
    
  2. or download this
    sub submatrix_sum {
        my $w = shift;
    ...
        $m->range(ndcoords($m($w - 1:, $h - 1:), [$w, $h])->reorder(2, 3, 
    +0, 1)
            ->clump(2)->sumover;
    }