Accessing multiple NETCDF files in a loop
조회 수: 2 (최근 30일)
이전 댓글 표시
I have several NETCDF files (different times of day). Each gives me divergence profiles. I wish to call each files in a loop (and store variables separately.). For example "profile.20140730_015009.MDV.nc" isfirst .nc file .Actually I wish to produce time series plot with it later on.
ncid1=netcdf.open('profile.20140730_015009.MDV.nc','nowrite');
[ndim, nvar, natt, unlim] = netcdf.inq(ncid1)
[dimname, dimlength] = netcdf.inqDim(ncid1, 0)
[varname, xtype, dimid, natt] = netcdf.inqVar(ncid1,0)
[varname, xtype, dimid, natt] = netcdf.inqVar(ncid1,1)
[varname, xtype, dimid, natt] = netcdf.inqVar(ncid1,2)
[varname, xtype, dimid, natt] = netcdf.inqVar(ncid1,3)
[varname, xtype, dimid, natt] = netcdf.inqVar(ncid1,4)
[varname, xtype, dimid, natt] = netcdf.inqVar(ncid1,5)
[varname, xtype, dimid, natt] = netcdf.inqVar(ncid1,6)
[varname, xtype, dimid, natt] = netcdf.inqVar(ncid1,7)
[varname, xtype, dimid, natt] = netcdf.inqVar(ncid1,8)
[varname, xtype, dimid, natt] = netcdf.inqVar(ncid1,9)
DIV = netcdf.getVar(ncid1,9,[0],[30])
DIVV=-(DIV);
z=netcdf.getVar(ncid1,5,0,30)
plot(DIVV,z);
axis([-3 3 0 15]);
xlabel ('Divergence (m/s^2)')
ylabel ('Vertical Height z (Km)')
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 NetCDF에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!