combine 2 netcdf files into one

10 Ansichten (letzte 30 Tage)
Jian Lu
Jian Lu am 3 Jun. 2015
Bearbeitet: Ashish Uthama am 3 Jun. 2015
I try to combine two netcdf files (lat.nc and lon.nc) into one, but the resultant file (lat_lon.nc) contains all NaN values. The code of mine is:
nccreate('lat.nc','lat','dimensions',{'s' 56 't' 1}); ncwrite('lat.nc','lat',lat); info0 = ncinfo('lat.nc');
nccreate('lon.nc','lon','dimensions',{'n' 192 't' 1}); ncwrite('lon.nc','lon',lon); info00 = ncinfo('lon.nc');
savefile='lat_lon.nc'; ncwriteschema(savefile,info00); ncwriteschema(savefile,info0);

Antworten (1)

Ashish Uthama
Ashish Uthama am 3 Jun. 2015
Bearbeitet: Ashish Uthama am 3 Jun. 2015
ncwriteschema only writes the 'schema',i.e things like variable and dimension definitions. You still need to follow this with an ncwrite to actually write the data.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by