- 积分
- 20368
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-8-6
- 最后登录
- 1970-1-1
|
发表于 2015-6-16 22:25:42
|
显示全部楼层
Aires 发表于 2015-6-16 19:05
I think the code is no problem because I have selected the SST domain, so the weighted should be p ...
楼主,程序中提示了“weighted for each latitude of sst, weight = sqrt(cos(lat))”,- ......
- a=lon;
- b=lat;
- lon_num=length(a);
- lat_num=length(b);
- sst=xlsread('D:precip.xlsx');
- sst=double(sst);
- sst(sst<-1000)=NaN;
- % weighted for each latitude of sst, weight = sqrt(cos(lat))
- weight=sqrt(cos(lat(b)*pi/180));
- ......
复制代码 其中,weight=sqrt(cos(lat(b)*pi/180));运行时出错了,错误提示:
Index exceeds matrix dimensions.
Error in test_SEOF (line 24)
weight=sqrt(cos(lat(b)*pi/180));
再根据后面程序:
for i=1:lat_num
seof1(:,i,:)=seof1(:,i,:)/weight(i);
seof2(:,i,:)=seof2(:,i,:)/weight(i);
end
修改成:
weight=sqrt(cos(lat*pi/180));
可以运行了,
麻烦楼主再次检查下。谢谢。
|
|