julia> M = randn(5,5)5x5 Array{Float64,2}:-1.51134 1.2331 -0.186083 0.412282 -1.13114-0.0411132 0.124684 0.377426 0.622427 -0.2781620.788182 -0.834092 1.09506 1.45196 -0.6207171.45856 -0.889277 -0.768049 -0.95953 -0.3400981.69666 0.695566 0.706905 0.63089 0.958474julia> mean(M[M .> 0])0.8751552351448673
julia> function meanpos(a)t = zero(eltype(a))c = 0for x in ax > 0 || continuet += xc += 1endreturn t/cendmeanpos (generic function with 1 method)julia> meanpos(M)0.8751552351448673