Help for this page

Select Code to Download


  1. or download this
    (  0  0  0 ...)
    ( -1  0  0 ...)
    (  0 -1  0 ...)
    (  0  0 -1 ...)
    ...
    
  2. or download this
    # 4 dimensions
    my $matrix = pdl([[0,0,0,0],[-1,0,0,0],[0,-1,0,0],[0,0,-1,0]]);
    ...
    my $pdl = pdl(...);
    my $diff = $pdl x $matrix; # not sure about whether to use left- or ri
    +ght-multiplication here
    my $res = $pdl + $diff;