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 = ['http://motherlode.ucar.edu:8080/thredds/dodsC/satellite/CTP/SUPER-NATIONAL_1km/current/SUPER-NATIONAL_1km_CTP_',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 =

UNIDATA