Hello. I have Lat(2689×1) Lon(2689×1) arrays that coordinaines coordinates of meteostations, and lat (1200×200) lon (1200×200) arrays with coordinates of satellite's measurements M(1200×200). I need to find elements of satelletes measurements, that located closer then 0.25 deg to meteostations. What i've did:
k=1;for m=1:length(Lat) x=lat-Lat(m); y=lon-Lon(m); [a,b]=find(abs((x))<=0.25 & abs((y))<=0.25); for n=1:length(a) Mes(k,n)=M(a(n),b(n)) end St_N(k)=m; k=k+1;end;
Because of many loops it works very long. Is there any way to vectorise or speedup this code?
Best Answer