Guest User

Untitled

a guest
May 22nd, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #!/usr/bin/awk -f
  2. #
  3. # Programa para calcular média e desvio padrão em awk
  4. #-----------------------------------------------------------------------
  5.  
  6. {
  7. soma+=$1
  8. somaquad+=$1*$1
  9. }
  10.  
  11. END {
  12. media=soma/NR
  13. desvpad=sqrt((somaquad - NR*media**2)/(NR - 1))
  14. printf "%.1f(%.1f)\n", media, desvpad
  15. }
Add Comment
Please, Sign In to add comment