Re: [julia-users] How to make vector 'c' such that they are the values of the vector "a" but not in the vector "b"?
Thx, my idea was to long;) c=copy(a) deleteat!(c,findin(a,b)) Paul W dniu poniedziałek, 2 lutego 2015 13:43:18 UTC+1 użytkownik Tamas Papp napisał: > > Perhaps > > setdiff(a, b) > > or > > a[indexin(a, b) .== 0] > > I don't know which is faster, for small arrays it should not matter. > > Best, > > Tamas > > On Mon, Feb 02 2015, paul analyst > > wrote: > > > How to make vector 'c' such that they are the values of the vector "a" > but not > > in the vector "b"? > > > > (Excluding the value of b with a ) > > > > julia> b=[1 2 5] > > 1x3 Array{Int64,2}: > > 1 2 5 > > > > julia> a=[1:1:10] > > 10-element Array{Int64,1}: > > 1 > > 2 > > 3 > > 4 > > 5 > > 6 > > 7 > > 8 > > 9 > > 10 > > > > expected c: 3 4 6 7 8 9 10 > > > > Paul >
Re: [julia-users] How to make vector 'c' such that they are the values of the vector "a" but not in the vector "b"?
Perhaps setdiff(a, b) or a[indexin(a, b) .== 0] I don't know which is faster, for small arrays it should not matter. Best, Tamas On Mon, Feb 02 2015, paul analyst wrote: > How to make vector 'c' such that they are the values of the vector "a" but not > in the vector "b"? > > (Excluding the value of b with a ) > > julia> b=[1 2 5] > 1x3 Array{Int64,2}: > 1 2 5 > > julia> a=[1:1:10] > 10-element Array{Int64,1}: > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > 10 > > expected c: 3 4 6 7 8 9 10 > > Paul
[julia-users] How to make vector 'c' such that they are the values of the vector "a" but not in the vector "b"?
How to make vector 'c' such that they are the values of the vector "a" but not in the vector "b"? (Excluding the value of b with a ) julia> b=[1 2 5] 1x3 Array{Int64,2}: 1 2 5 julia> a=[1:1:10] 10-element Array{Int64,1}: 1 2 3 4 5 6 7 8 9 10 expected c: 3 4 6 7 8 9 10 Paul