octcdf

Andres Sepulveda andres.sepulveda at gmail.com
Mon Sep 1 09:06:10 CDT 2008


  Hi,

  I have a code which searchs for a specific dimension inside a NetCDF file.

nc=netcdf(fname,'write');
tlen =  length(nc('tclm_time'));
tlen
if tlen==0
  tlen=1;
end

but is the file doesn't has that field it stops with the following error

error: Error while querying dimension tclm_time: NetCDF: Invalid
dimension ID or name
error: evaluating argument list element number 1

is there a way the variable tlen would just become 0, rather than to
give that error message?

 Regards,

    Andres


More information about the Help-octave mailing list