读取单个nc文件的方法:clc,clear;
ncid = netcdf.open('D:\precip.mon.1981-2010.ltm.nc','NOWRITE');
%打开nc文件
ncdisp('precip.mon.1981-2010.ltm.nc');
%在命令窗中显示nc文件的变量
PrecipData =
ncread('precip.mon.1981-2010.ltm.nc','precip');
%读入变量precip
TimeData =
ncread('precip.mon.1981-2010.ltm.nc','time');
%读入变量time
LonData =
ncread('precip.mon.1981-2010.ltm.nc','lon');
%读入变量lon
LatData =
ncread('precip.mon.1981-2010.ltm.nc','lat');
%读入变量lat
Valid_yr_countData =
ncread('precip.mon.1981-2010.ltm.nc','valid_yr_count');
%读入变量validprecip_yr_count
ClimatologyData =
ncread('precip.mon.1981-2010.ltm.nc','climatology_bounds');
%读入变量climatol