I think this is really simple but I can’t figure it out.
I have a function which I broadcast, something like:
function gives3(x)
return x^2, x^3, x^4
end
inputs = [1, 2, 3, 4, 5]
output = gives3.(inputs)
output is a Vector{Tuple{Int64, Int64, Int64}}. I want to unpack these tuples and have them in separate vectors, so that when I write (or something similar):
v1, v2, v3 = gives3.(inputs)
I’d like:
julia> v2
5-element Vector{Int64}:
1
8
27
64
125
Any idea on how to make this happen? I’m OK changing how gives3() returns stuff as long as I can return 3 elements.