Anonymous user
Averages/Root mean square: Difference between revisions
→{{header|AWK}}: compute RMS
(→{{header|MATLAB}}: simplify code) |
(→{{header|AWK}}: compute RMS) |
||
Line 119:
6.204837
</pre>
=={{header|AWK}}==
<lang awk>#!/usr/bin/awk -f
# computes RMS of the 1st column of a data file
{
x = $1; # value of 1st column
S += x*x;
N++;
}
END {
print "RMS: ",sqrt(S/N);
}</lang>
=={{header|BBC BASIC}}==
|