Detect missing value between two vectors that are similar, but not the same!

6 views (last 30 days)
Hi everyone,
If I got two vectors (A and B) like you can see downbelow:
if true
% code
A = [26 3553 7064 10558 14048 17568]
B = [3503 7002 10481 13927 17544]
end
How can I find the correct missing index and replace add the value that is suppose to near the opposite value?
In this case I would like to change B, so it got a result like this:
if true
B_new = [ 8 3503 7002 10481 13927 17544]
end
B_new(1), doesn't have to be 8, but a number that is close to A(1) and follow the pattern of change in B.
Thank you in advance :)
  1 Comment
dpb
dpb on 19 Jul 2018
Perhaps not terribly efficient but what about pairing by minimizing distances pdist2 and then your left with "odd man out" for the one with the largest difference. That would presume there my not be two very similar values in the same series.

Sign in to comment.

Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!