#!/usr/bin/perl use warnings; use strict; use PDL::LiteF; my $a = pdl([ [1, , , ], [4, -5, , ], [7, -8, -9, ], [17, -18, -90, 114], ]); print $a,"\n"; my $b = transpose($a); print "$b\n"; my $c = $a+ $b; print "$c\n"; my $d = $a->diagonal(0,1); print "$d\nNeeds to be padded with zeros and subtracted from \$c\n"; print "I'll leave that to you. :-)\n";