I'm trying to compute two matrices , one of which is 400*2 and the other being 20*20. The first one contains x and y coordinates of 400 points and the second being another 400 points with x's being 2nd(i,i) and y's being (i,k) both i and k's are 20 number counters.I'm trying to compute the distances between those 2 matrix points which would give me 400*400 matrix. The code i'm using is ;
for i=1:20
for j=1:400
for k=1:20
L(j,)=sqrt((C(j,1)-M(i,i))^2+(C(j,2)-M(k,i))^2);
end
end
end
C being the first matrix and M being the second. Now i know i made it sound a little hard but the trouble is i cant find a counter to give to L(j, ) that part. If you guys have any idea please do tell...
Edit: Well first of all think there is 2 point vectors. X's being -0.95:0.1:0.95 and y's are the same. M vector is that all of the x's paired with a Y so it would make 20*20 matrix or a 400*2 however i could not make it work like a 400*2 so have gone with 20*20.The matrix is a little hard for me to do so my indexing of M shows that.If you got a better way to pair them i would appreciate it as well.
My matrix looks like this ;
-0.95 -0.85 -0.75...
-0.95 -0.85 -0.75 ...
.
.
.