Hi, I have two matrixes and wish to replace the first column of matrix A, with elements of the fourth column of matrix B, but just in the case the elements of the first columns of A and B are equal.
I tried the following, but its probably not correct. Can someone help me out?
for j=1:size(A,1)
if A(j,1)==B(:,1); A(j,1)=B(:,4); endend
Best Answer