I have an array
a = zeros(2,3)
2×3 Matrix{Float64}:
0.0 0.0 0.0
0.0 0.0 0.0
and I want to create a Bool array of same size with all values set to false.
I have an array
a = zeros(2,3)
2×3 Matrix{Float64}:
0.0 0.0 0.0
0.0 0.0 0.0
and I want to create a Bool array of same size with all values set to false.
Another option is to use zeros with Bool as the type option:
julia> zeros(Bool, size(a))
2×3 Matrix{Bool}:
0 0 0
0 0 0
You can combine similar and fill! to achieve what you want.
julia> a = zeros(2,3)
2×3 Matrix{Float64}:
0.0 0.0 0.0
0.0 0.0 0.0
julia> fill!(similar(a, Bool), false)
2×3 Matrix{Bool}:
0 0 0
0 0 0