Version 2018a. The goal is to remove all unwanted data or to extract just the desired rows.
I've got two sets of data (D1 and D2) that are made up of an equal number of columns. The number of rows of each data set may be different.
The values in the second column vary slightly between both sets. However, if a number in the second column from D1 also appears somewhere in column two from D2, extract both of those rows. Alternatively, delete all rows from D1 and D2 with a value in column two that does not have an equal.
I've made some progress using ismember and intersect, but I'm hitting a wall trying to apply the row indices in a loop. Maybe there's a cleaner way to go about this?
PS: Here's a more advanced question. If a value in col 2 of D1 is within 10% of a value in col 2 of D2, then accept each of those rows to compare. I struggle with this because what if there's a tie for multiple rows. How would you determine a preference?