Matlab處理氣象數據(十一)數據的異常值計算

%平均溫度的異常值計算
load('Tem1.mat');%導入NCEP數據的面積加權年平均
load('Tem2.mat');%導入觀測數據的面積加權年平均
m1=mean(Tem1); %求Tem1的平均值
m2=mean(Tem2);
a1=Tem1-m1; %求Tem1的距平
a2=Tem2-m2;
plot(a1,'r.-','linewidth',2);%畫NCEP數據年平均氣溫折線圖,紅色實線實心點
hold on
plot(a2,'b.-','linewidth',2);
axis([ -inf inf -1.5 1.5]); %設置縱座標範圍
legend({'NCEP','Observed'},'Location','Northwest');%添加圖例
set(gca,'xtick',[2 7 12 17 22 27 32],'xticklabel',{'1980','1985','1990','1995','2000','2005','2010'});%在x軸特定位置上添加標註
set(gca, 'FontSize',10,'FontWeight','Bold','tickdir','out') %設置標註爲10號字、加粗、標記線向外
h=xlabel('Year'); %設置x軸名稱
set(h, 'FontSize',10,'FontWeight','Bold')
h=ylabel('Temperarure(\circC)'); %設置y軸名稱
set(h, 'FontSize',10,'FontWeight','Bold') 
xlim([1 35])%x軸範圍鎖定爲1~35
box off %去掉外框
hold off

在這裏插入圖片描述

NCEP數據和觀測數據平均溫度的異常值
%最高溫度的異常值計算
load('Temmax1.mat');
load('Temmax2.mat');
amax1=Temmax1-mean(Temmax1); %求Temmax1的距平
amax2=Temmax2-mean(Temmax2);
plot(amax1,'r.-','linewidth',2);%畫NCEP數據最高氣溫折線圖,紅色實線實心點
hold on
plot(amax2,'b.-','linewidth',2);
axis([ -inf inf -1.5 1.5]); %設置縱座標範圍
legend({'NCEP','Observed'},'Location','Northwest');%添加圖例
set(gca,'xtick',[2 7 12 17 22 27 32],'xticklabel',{'1980','1985','1990','1995','2000','2005','2010'});%在x軸特定位置上添加標註
set(gca, 'FontSize',10,'FontWeight','Bold','tickdir','out') %設置標註爲10號字、加粗、標記線向外
h=xlabel('Year'); %設置x軸名稱
set(h, 'FontSize',10,'FontWeight','Bold')
h=ylabel('Temperarure(\circC)'); %設置y軸名稱
set(h, 'FontSize',10,'FontWeight','Bold')
xlim([1 35])%x軸範圍鎖定爲1~35
box off %去掉外框
hold off

在這裏插入圖片描述

NCEP數據和觀測數據最高溫度的異常值
%最低溫度的異常值計算
load('Temmin1.mat');
load('Temmin2.mat');
amin1=Temmin1-mean(Temmin1); %求Temmin1的距平
amin2=Temmin2-mean(Temmin2);
plot(amin1,'r.-','linewidth',2);%畫NCEP數據最低氣溫折線圖,紅色實線實心點
hold on
plot(amin2,'b.-','linewidth',2);
axis([ -inf inf -1.5 1.5]); %設置縱座標範圍
legend({'NCEP','Observed'},'Location','Northwest');%添加圖例
set(gca,'xtick',[2 7 12 17 22 27 32],'xticklabel',{'1980','1985','1990','1995','2000','2005','2010'});%在x軸特定位置上添加標註
set(gca, 'FontSize',10,'FontWeight','Bold','tickdir','out') %設置標註爲10號字、加粗、標記線向外
h=xlabel('Year'); %設置x軸名稱
set(h, 'FontSize',10,'FontWeight','Bold')
h=ylabel('Temperarure(\circC)'); %設置y軸名稱
set(h, 'FontSize',10,'FontWeight','Bold') 
xlim([1 35])%x軸範圍鎖定爲1~35
box off %去掉外框
hold off

在這裏插入圖片描述

NCEP數據和觀測數據最低溫度的異常值

相關鏈接:
Matlab處理氣象數據——目錄

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章