Exercise: On Average Index   <<   >>


 

avg1 ← +/ ÷ ⍴    ⍝ or   avg1 ← {(+/⍵)÷⍴⍵}

avg1¨ (1 2) (3 4 5) (6 5 4 3.14159)
↑ avg1¨ (1 2) (3 4 5) (6 5 4 3.14159)

avg1 1 2 3 4
avg1 1 2 3
avg1 1 2
avg1 1

avg1 x←?3 4 5⍴100

Replace avg1 in the expressions above by avg←+⌿÷≢ and compare against the results from avg1 .