I have two matrices A=500000*4 and B=4300000*4.
Matrix A = id, plus 3 columns of NaN.
Matrix B = id, lat, lon, elev.
I would like to find the id values in A = B, and based on those same id values, fill matrix A with the missing lat,lon,elev.
The code I have is:
for i=1:length(A) ind = B(:,1)==A(i,1); A(i,2:4) = B(ind,2:4); clear indend
This works but is extremely slow. How can I do this more efficiently?
Thanks
Jon
Best Answer