|
|
Line 47: |
Line 47: |
| (+⌿÷≢) 3 4.5 7 21 | | (+⌿÷≢) 3 4.5 7 21 |
| 8.875 | | 8.875 |
| </source>
| |
|
| |
| The operator <source lang=apl inline>⌿</source> can also be used to modify the <source lang=apl inline>(+⌿÷≢)</source> function to produce a moving average.
| |
| <source lang=apl>
| |
| 2 (+⌿÷≢)/ 3 4.5 7 21
| |
| 3.75 5.75 14
| |
| </source>
| |
| or, more verbosely
| |
| <source lang=apl>
| |
| ave ← +⌿÷≢
| |
| ave 3 4.5 7 21
| |
| 8.875
| |
| mave ← ave⌿
| |
| 2 mave 3 4.5 7 21
| |
| 3.75 5.75 14
| |
| </source> | | </source> |
|
| |
|