- 积分
- 9
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-10-7
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
求教下面的口令总是出现Subscripted assignment dimension mismatch,
我是想要拿到47年新加坡的降雨和平均温度,我试着想要从47个每年的nc文件里面把表示新加坡的地理坐标的降雨和温度数据拿到,所以写了下面的口令:
谢谢!
>> vardata = zeros (360,280,366,47);
for year = 1961:2007
upperfolder = '/Users/apple/Desktop/CE4104/Data/APHRODITES/V1101/APHRO_MA_025deg_V1101.';
yearstr = num2str(year);
extension = '.nc';
filename = [upperfolder yearstr extension];
upperfolder2 = '/Users/apple/Desktop/CE4104/Data/APHRODITES/V1204 R1/APHRO_MA_TAVE_025deg_V1204R1.';
yearstr2 = num2str(year);
filename2 = [upperfolder2 yearstr2 extension];
precip(:,:,1:366,year-1960) = ncread(filename,'precip');
temp(:,:,1:366,year-1960) = ncread(filename2,'tave');
if rem (year,4) ==0
days == 366;
else
days == 365;
end
precip(:,:,1:days,year-1960) = ncread(filename,'precip');
precipSingapore (175:177,63:65,1:days,year-1960) = precip(175:177,63:65,1:days,year-1960);
temp(:,:,1:days,year-1960) = ncread(filename2,'tave');
tempSingapore(175:177,63:65,1:366,year-1960) = temp(175:177,63:65,1:days,year-1960);
end
Subscripted assignment dimension mismatch.
|
|