matlab绘制某一地区多年季节平均温度

标签:
文化 |
分类: programme |
这里是北京地区1952-2002年冬季的平均温度
%方法一
clear
clc
clf
% load file
load /d:/example/t160.mat
%set Beijing code
code = 37
tDec = t160(code,1:51,12)
tJan = t160(code,2:52,1)
tFeb = t160(code,2:52,2)
tBeijing = (tDec + tJan + tFeb)./3
tBeijing = tBeijing(:)./10
yr = 1952:2002
plot(yr,tBeijing,'b-o')
xlabel('Year','fontsize',10)
ylabel('Winter temp')
title('way 1')
grid on
saveas(gcf,'d:/example/mean.png')

%方法二
clear
clc
clf
load d:/example/t160.mat
code = 37
tDec = t160(code,1:51,12)
save tbeijing12.mat tDec
tJan = t160(code,2:52,1)
tFeb = t160(code,2:52,2)
save tbeijing1_2.mat tJan tFeb
load d:/example/tbeijing12.mat
load d:/example/tbeijing1_2.mat
t_mean = (tDec + tJan + tFeb)./3
t_mean = t_mean./10
yr = 1952:2002
plot(yr,t_mean,'b-o')
xlabel('Year','fontsize',10)
ylabel('winter temp')
title('way 2')
grid on
saveas(gcf,'d:/example/beijingwinter.png')
前一篇:radar 基础
后一篇:matlab中的一些基础(13)