From: Priom Rahman on 11 Aug 2010 06:19 Hi Carl, Thank you for your post, Learing something new everyday !! I didnt know how to just make a martix of dates in matlab, so I just did it in excel, and saved it as a "date_mat" and brought it over to matlab. (Good thing I only need to do this once !!) Afterwhich I used this code: -------------------------------------------------- %%%%%%%%%%%%% specify j counter as 1 j = 1; %K = 1 to total size of dates for k =1:size(date_mat,1) % Current date on the date matrix cdate1 = datenum(date_mat(k,1), date_mat(k,2), date_mat(k,3)); % Current date in record cdate2 = datenum(Rain_frag(j,1), Rain_frag(j,2), Rain_frag(j,3)); if cdate1 == cdate2 ObsRainSAcom_frag(k,4:244) = Rain_frag(j,4:244); j = j+1; end end ------------ this gave me the middle result i needed to go ahead and class all my rain (same results as yours) I tried your code, and it look 0.05 seconds as oppsed to the 2.5 seconds for mine. So 50 times better ! Thank you for replying, I now know how to do it in matlab - I guess it was hard to look for something in help when I didnt really know what to look up. =) Regards Priom |