How to create silimilar this vector range()
julia> [1:10:40;45]
5-element Array{Int64,1}:
1
11
21
31
45
I expect something like :
collect(range( x,y,z,;?)
1
11
21
31
45
Thx, Paul
How to create silimilar this vector range()
julia> [1:10:40;45]
5-element Array{Int64,1}:
1
11
21
31
45
I expect something like :
collect(range( x,y,z,;?)
1
11
21
31
45
Thx, Paul
Are you looking for
julia> vcat(range(1, 40, step=10), 45)
5-element Array{Int64,1}:
1
11
21
31
45
?
Also:
vcat(1:10:40,45)
No, a range cannot describe that sequence. Only uniformly spaced sequences are possible.
So Iterators.flatten((0:3:10, 12))
creates an iterator corresponding to your example,
julia> collect(Iterators.flatten((0:3:10, 12)))
5-element Array{Int64,1}:
0
3
6
9
12
but it is not guaranteed that this will work everywhere where you could use a Range
, so for example it does not support getindex
.
Thanks… si only vec.