Is there a slick way to rewrite this Julia function, perhaps using just 1 line of code, without making it much slower? (I just started using Julia. It\'s great!) K
K
I haven't tested the performance, but using the hist function should work:
hist(zd,0.5:K+0.5)[2]
gives:
5-element Array{Int64,1}: 1 4 1 0 0
or, if the zeros are unimportant, just use
hist(zd)[2] 3-element Array{Int64,1}: 1 4 1