![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C language to calculate mean,variance | cdfd123 | High Level Programming | 9 | 11-12-2008 01:39 AM |
| Calculating quantiles in SQL | figaro | UNIX for Dummies Questions & Answers | 3 | 11-20-2007 05:55 PM |
| calculating size of int | apoorvasharma80 | High Level Programming | 10 | 11-01-2006 06:44 PM |
| PERL - DB programming | satguyz | UNIX for Dummies Questions & Answers | 3 | 02-24-2006 02:45 PM |
| Calculating the day of the week | ligs | UNIX for Dummies Questions & Answers | 4 | 10-27-2001 09:28 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
#!/usr/bin/perl -w
use strict; open(FH,"$ARGV[0]") or die; my @temp=<FH>; close FH; my $mean = Mean(\@temp); my $var = variance(\@temp); print "$var\n"; sub estimate_variance { my ($arrayref) = @_; my ($mean,$result) = (mean($arrayref),0); foreach (@$arrayref) { $result += ($_ - $mean)**2 } return $result / $#{$arrayref}; } error shown: Undefined subroutine &main::variance called at variance_try1.pl line 9. wht can be possible solution?? Last edited by cdfd123; 01-12-2008 at 10:47 AM.. Reason: correcting string |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|