I find your code a bit hard to read (an expression is possible redundant/repeated?), but you are perhaps looking for comprehensions:
https://docs.julialang.org/en/v1/manual/arrays/#man-comprehensions
I find your code a bit hard to read (an expression is possible redundant/repeated?), but you are perhaps looking for comprehensions:
https://docs.julialang.org/en/v1/manual/arrays/#man-comprehensions