This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
>To: support <address@hidden> >From: Olivier Germain <address@hidden> >Subject: Increasing the size of a variable in a re-opened file >Organization: UCAR/Unidata >Keywords: 200110251650.f9PGod127998 Hi Olivier, > I'm beginning with NetCDF ("under" Matlab) and I have a simple question: > how to have a variable's size increased (and the variable populated) in > a re-opened file ? > I guess this involves redef/endef/fillmode but I haven't succeeded yet. In netCDF, only variables that use the "unlimited" dimension can increase in size after they are defined, and only along that dimension. So if you want to have a variable grow along a dimension, it has to be the first dimension, and it has to be defined as the unlimited (or "record") dimension. You don't say which of the MATLAB netCDF interfaces you are using, but there may be examples in the documentation for how to do this. See http://www.unidata.ucar.edu/packages/netcdf/software.html#MATLAB and the links it leads to. --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu