A is a matrix with a bigger size than the B matrix. B is a subset of A (except the last column that I am trying to fill A;s last column with the respective values of B's last column). I wrote the following loop that has been running for more than an hour although it should be simple. I hoe someone can help me to reduce the computation time:
for m=1:size(A,1) for n=1:size(B,1) x0a=A(:,2)==B(n,2) & A(:,1)==B(n,1); if ~isempty(x0a) A(m,end)=B(x0a,end); end endend
Best Answer