I am having a bit of trouble with my for loop. I have two data sets of A and B with a different number of rows but same number of columns. I would like the dimension size to match by taking the remaining points left in the larger matrix and finding the closest points (smallest distance) of that in the other set. This is done by the knnsearch function in matlab. Currently I am getting the error of "In an assignment A(I) = B, the number of elements in B and I must be the same." but when I remove the i from New_Bi the loop over writes itself... Any suggestions?!?
Thanks in advance.