function fixmvaratt(infile) % fixvaratt- Gets rid of the '(deg)' or '(m)' at the end of the attributes in % some old netcdf files. %%% START USGS BOILERPLATE ------------- % Programs written in Matlab- as early as 7.2.0.232 (R2006a) and % most recent modifications in v7.8.0 (R2009a) % Programs ran on PC with Windows XP Professional OS, and RHEL4 linux. % % "Although this program has been used by the USGS, no warranty, % expressed or implied, is made by the USGS or the United States % Government as to the accuracy and functioning of the program % and related program material nor shall the fact of distribution % constitute any such warranty, and no responsibility is assumed % by the USGS in connection therewith." %%% END USGS BOILERPLATE -------------- nc = netcdf(infile,'write') inatts = att(nc); for i = 1:length(inatts); attname = name(inatts{i}); j = findstr('(',attname); if ~isempty(j) newname = attname(1:j-1) eval (['nc.' newname '= inatts{i}(:);']); delete (inatts{i}); end end close (nc)