diff options
author | fpi | 2022-02-20 18:55:04 +0100 |
---|---|---|
committer | fpi | 2022-03-17 14:29:07 +0100 |
commit | 15af0dc407c2198b130fc5984467a24d6c0f3225 (patch) | |
tree | 8441f2ed9efe90c5e9807b8f548a2cfec0220b8d | |
parent | Add settings for printable A4 plots (diff) |
Run avg init function on startup
-rw-r--r-- | gnuplot.org | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gnuplot.org b/gnuplot.org index 782ae5d..2f8a6bf 100644 --- a/gnuplot.org +++ b/gnuplot.org @@ -43,6 +43,7 @@ A collection of functions that can calculate a running average. # running averages samples(x,n) = $0>(n-1) ? n : ($0+1) init(x)=(back1=back2=back3=back4=back5=back6=back7=back8=back9=back10=back11=back12=sum=0) +if(init(0)){} # what is the best way to run functions without showing output? avg1(x)=(back1=x,back1) avg2(x)=(back2=back1,(avg1(x)+back2)/samples($0,2)) avg3(x)=(back3=back2,(samples($0,2)*avg2(x)+back3)/samples($0,3)) |