Hey, I’m new to Julia and not sure about some issues regarding arrays. One of these is this one:
I just want to bind several vectors with zeros to an array. Their length is given in another array like that:
length = [10 20 30 40....]
Now I do the following:
zeroarray = zeros(length) zeroarray = vcat([zeroarray], zeros(length) for i in 3:length(length) zeroarray = vcat(zeroarray, zeros(length[i]) end
This looks not like the appropriate approach to me. I would like to know how to formulate this properly. For explanation, this is the equivalent in python:
import numpy as np length = [10, 20, 30, 40,....] zeroarray = [np.zeros(length)] for i in range(1, len(length)): zeroarray.append(np.zeros(length[i]))
I would be very thankful for further advice!