how to find nearest date corresponding value ?
26 views (last 30 days)
Hi, i am really stuck here and can not move ahead !
i have written this code to match the date which works fine as expected.
N = AOD_440(:,1);
V = A(:,1);
B = repmat(N,[1 length(V)])
[minValue,closestIndex] = min(abs(B-V'));
closestValue = N(closestIndex);
but here AOD_440 has second column which has some values. so when above code is finding its closest date it should put the corresponding value in second column !
how can we just update the above code ?
or do I need to write different method code ?
i hope you understand the question !