in reply to Re: Calc distance between atoms in pdb file
in thread Calc distance between atoms in pdb file

I'm getting an error of uSE OF UNINITIALIZED VALUE IN SUBTRACTION AT LINE 47
foreach my $i ( 0 .. 1520) { foreach my $j ( $i + 1 .. 1520 ) { my $dist = sqrt( ($arrayx[$i] - $arrayx[$j])**2 + ($arrayy[$i] - $arrayy[$j])**2 + ($arrayz[$i] - $arrayz[$j])**2 ); ## Adding $i and $j to your output will let you know what that print "$i <> $j : $dist\n"; } } exit 0;

Replies are listed 'Best First'.
Re^3: Calc distance between atoms in pdb file
by soonix (Chancellor) on Nov 14, 2016 at 11:17 UTC
    Where do the 1520 come from? Obviously not from the originally posted code.
      I took the value to $count-1 ... that is where 1520 came from