I would like to create a 1×1 array (say an Array{Float64,2}) and initialize it to some value. Of course this works:
M=zeros(1,1)
M[1,1]=0.1234
Is there a more concise way to create M and initialize it at the same time?
Since [1.1234] will give you a Vector in Julia the simplest way I could come up with is:
julia> fill(1.234,1,1)
1x1 Array{Float64,2}:
1.234
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With