Modern Physics Electronic Laboratory Journal.
%practice script from the matlab interactive tutorial %loading data into the matlab editor
load annual_temps %LOADING THE RELEVANT DATA
plot(year,annual) title('HadCRUT3 Temperature Anomaly Measurements') xlabel('Year') ylabel('Temperature Anomaly (°c)') % PLOTTING THE RAW
annual_avg = mean(annual); figure area(year,annual_avg) title('Average Annual Temperature Anomaly') xlabel('Year') ylabel('Temperature Anomaly (°c)')
k = 1/5*ones(1,5); five_year_avg = convn(annual_avg,k,'valid'); plot(year,annual_avg,'--o') hold on plot(year(3:end-2),five_year_avg,'r') legend('Annual Avg', 'Five Year Avg')
No comments:
Post a Comment