Two separate vectors of same length and eliminating items in both vectors, whenever the values of those vectors are the same at identical columns. Depending on this the values of a third vector shall be eliminated accordingly

Two separate vectors of same length (but the lenghth can vary and is not predictable) and eliminating items in both vectors, whenever the values of those vectors are the same at identical columns. Depending on this the values of a third vector shall be eliminated accordingly

Sounds complicated but maybe a simple example self-explaining:

x = [0.1, 0.2, 0.3, 0.4, 0.5]
y = [0.2, 0.3, 0.3, 0.4, 0.6]
co = [0.7, 0.8, 0.9, 1.0, 1.1]

x’ = [0.1, 0.2, 0.5]
y’ = [0.2, 0.3, 0.6]
co’ = [0.7, 0.8, 1.1]

any idea to realize that?

julia> idxs = x .!= y
5-element BitVector:
 1
 1
 0
 0
 1

julia> x[idxs]
3-element Vector{Float64}:
 0.1
 0.2
 0.5

julia> y[idxs]
3-element Vector{Float64}:
 0.2
 0.3
 0.6

julia> co[idxs]
3-element Vector{Float64}:
 0.7
 0.8
 1.1


3 Likes