Chapter 4.  NC_ATTGET

Retrieving attributes is even easier than variables. To get, say, the units of the time variable, that's as easy as

today = datestr(floor(now),'yyyymmdd');          
url = ['',today,'_0000.gini'];
units = nc_attget ( url, 'time', 'units' )

units =

msecs since 1970-01-01T00:00:00Z

And to retrieve a global attribute, use the mnemonic m-file nc_global.m in place of the variable name.

cname = nc_attget ( url, nc_global, 'creator_name' )

cname =