MATLAB: Do I receive an error when reading a netCDF file using CDFREAD command in MATLAB 7.9 (R2009b)

MATLAB

I have a netCDF file (test.cdf). When I try to read this file using the CDFREAD command in MATLAB 7.9 (R2009b), I receive the following error:
??? Error using ==> cdfinfoc
Error issued from CDF library: "NOT_A_CDF_OR_NOT_SUPPORTED: Named CDF is corrupted or not supported by the
current library version."

Best Answer

This enhancement has been incorporated in Release 2013a (R2013a). For previous product releases, read below for any possible workarounds:
The issue is due to the fact that the file that you are trying to read is a netCDF file and not a CDF file. Some of the netCDF files were also created with the 'cdf' extension. These files cannot be read using the CDFREAD command. The netCDF and CDF formats are entirely incompatible. You should be able to read the above netCDF file using the netcdf package in MATLAB 7.9 (R2009b). NetCDF best practices are currently to use 'nc' instead of 'cdf'.
The documentation explains in detail the procedure to access the netCDF files. Please search for the documentation section titled 'Importing Network Common Data Form (netCDF) Files' in the MATLAB help browser.