- 积分
- 25715
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-3-17
- 最后登录
- 1970-1-1

|

楼主 |
发表于 2016-1-9 13:02:16
|
显示全部楼层
先把日数据处理成逐月的,并且扩维,前阵子刚好有个程序可以参考
- yrstart=1979;
- yrend=2014;
- N=yrstart-yrend+1;
- Q1_m=nan(134,54,27,12,N);
- for k=yrstart:yrend
- data=ncread(['NCEP1.daily.Q1.' num2str(k) '.nc'],'Q1');
- m=size(data);
- if m(4)==365
- list=[31 28 31 30 31 30 31 31 30 31 30 31];
- else
- list=[31 29 31 30 31 30 31 31 30 31 30 31];
- end
- ind=1;
- for n=1:12
- Q1_m(:,:,:,n,k-yrstart+1)=mean(data(:,:,:,ind:ind+list(n)-1),4);
- ind=ind+list(n);
- end
- end
复制代码
有逐月数据以后取特点位置数据sum求和即可,如
Q_used=nansum(Q_m(:,:,:,[1 6 12],:),4);%如果想消去一维,可以参考squeeze函数 |
|