How can I pass an array containing the dimensions I desire to a function like ones or rand in Julia?
For example, I'd like to execute
dims = [3 4]
rand(dims)
and then receive something like
3×4 Array{Float64,2}:
0.300811 0.140124 0.756915 0.268328
0.732461 0.900773 0.251334 0.0338452
0.54227 0.439385 0.0812104 0.612996
as the output.
Executing the first code block returns a single number selected at random from the array dimen = [3 4], however, and rand(dims = dimen) returns a ERROR: function rand does not accept keyword arguments error.
Is there a way to do what I'm hoping to?