Reformat some code in Vector and only import what we need from Errno
[Math-GSL.git] / examples / correlation
blobc1dfa60169206fb428e7fbd7c18143646482e6c9
1 #!/usr/bin/perl -w
2 use Math::GSL::Statistics qw/gsl_stats_correlation/;
3 use strict;
5 my $data1 = [
6 17, 18, 16, 18, 12,
7 20, 18, 20, 20, 22,
8 20, 10, 8, 12, 16,
9 16, 18, 20, 18, 21
12 my $data2 = [
13 19, 20, 22, 24, 10,
14 25, 20, 22, 21, 23,
15 20, 10, 12, 14, 12,
16 20, 22, 24, 23, 17
19 my $x = gsl_stats_correlation($data1, 1, $data2, 1, 20);
20 print "x=$x\n";