Say I have 2 arrays of double precision in matlab, how can I merge them with unknown offsets?
For example:
A =
1 1
2 2
3 3
4 4
5 5
B =
2 6
3 5
4 4
5 3
6 2
Is there a way to create from these two arrays a single array with 3 columns like below when I don't know the offset/overlap between A and B in terms of values in the first column?
C =
1 1 NaN
2 2 6
3 3 5
4 4 4
5 5 3
6 NaN 2
Is there an efficient way to do this?
The solution I've come up with right now is to piece together the first columns of A and B, and then proceed to use a for loop to iterate through.