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

3 次查看(过去 30 天)
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 个评论
dpb
dpb 2018-7-19
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by