repl.txt (1289B)
1 2 {{alias}}( [out,] W ) 3 Returns an accumulator function which incrementally computes moving minimum 4 and maximum absolute values. 5 6 The `W` parameter defines the number of values over which to compute moving 7 minimum and maximum absolute values. 8 9 If provided a value, the accumulator function returns an updated moving 10 minimum and maximum. If not provided a value, the accumulator function 11 returns the current moving minimum and maximum. 12 13 As `W` values are needed to fill the window buffer, the first `W-1` returned 14 minimum and maximum values are calculated from smaller sample sizes. Until 15 the window is full, each returned minimum and maximum is calculated from all 16 provided values. 17 18 Parameters 19 ---------- 20 out: Array|TypedArray (optional) 21 Output array. 22 23 W: integer 24 Window size. 25 26 Returns 27 ------- 28 acc: Function 29 Accumulator function. 30 31 Examples 32 -------- 33 > var accumulator = {{alias}}( 3 ); 34 > var mm = accumulator() 35 null 36 > mm = accumulator( 2.0 ) 37 [ 2.0, 2.0 ] 38 > mm = accumulator( -5.0 ) 39 [ 2.0, 5.0 ] 40 > mm = accumulator( 3.0 ) 41 [ 2.0, 5.0 ] 42 > mm = accumulator( 5.0 ) 43 [ 3.0, 5.0 ] 44 > mm = accumulator() 45 [ 3.0, 5.0 ] 46 47 See Also 48 -------- 49