1 function gattval=ncgetgatt(filename,gattname)
2 % gattval=ncgetgatt(filename,gattname)
3 % read from file the value of global attribute
4 quiet=exist('q','var');
5 % fprintf('ncgetatt: file %s\n',filename);
6 ncid = netcdf.open(filename,'NC_NOWRITE');
7 gattval = netcdf.getAtt(ncid,netcdf.getConstant('NC_GLOBAL'),gattname);
8 disp(['global attribute ',gattname,'=',num2str(gattval)])