%% %% T holds temperatures from weather.com for Feb. 29, 2008 %% T=[50 49 49 48 48 47 47 47 49 52 55 58 60 61 62 61 60 58 55 53 52 51 51 50]; T=T(:); %% %% DT1 is change in temperature obtained using formula (4.1) %% DT2 is change in temperature obtained using formula (4.6) %% %% Written by Ming Gu for MA128A, Spring 2008 %% DT1 = [NaN;diff(T)]; DT2 = NaN*T; for k=3:22 DT2(k) = (T(k-2)-8*T(k-1)+8*T(k+1)-T(k+2))/12; end figure(1); plot(T,'b.') hold on; plot(T,'b-') title('Berkeley Temp per weather.com, Feb.29/08','FontSize',18); figure(2); plot(DT1,'b.') hold on; plot(DT1,'b-') plot(DT2,'r.') hold on; plot(DT2,'r-') title('Temp Change, Feb.29/08 ','FontSize',18);