Hello again, I think I made a mistake discribing the problem. I have two column vectors x1 and x2 both in increasing order. I need a column vector x3 such that the jth entry of x3 is the maximum ith entry x1 which is smaller than the jth entry of x2. Regards, Pantelis