This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> Organization: Biophysics Lab., University of Nijmegen, The Netherlands Hi, > Is there any conversion software available to convert any of the > formats mentioned in this group to the MATLAB format and vice versa? Yes, there is software for importing netCDF data into MATLAB. Here's the excerpt from http://www.unidata.ucar.edu/packages/netcdf/utilities.html MATLAB Interface An interface between Matlab and NetCDF called MEXCDF has been developed by Chuck Denham at the US Geological Survey in Woods Hole. MATLAB is a software package that integrates numerical analysis, matrix computation, signal processing and graphical display. MEXCDF is a complete interface between netCDF and MATLAB that uses the MATLAB mexfile utility to allow MATLAB users to read, write, and manipulate netCDF data files in an efficient manner, following the C language interface syntax found in the netCDF 2.3 users manual. In addition, the interface has been enhanced in several ways: * Dimensions and variables accessible by number or name. * Attributes accessible by number or name. * Parameters accessible by number or name. * Prepended "nc" not necessary for operation names. * Prepended "NC_" not necessary for specifying parameters. * Parameter names not case-sensitive. * Required lengths default to actual lengths via -1. * AutoScaling via "scale_factor" and "add_offset" attributes. As an example, to read the following 2D array 'elev' in file 'foo.cdf', short elev(lat, lon) elev:scale_factor=100. elev:add_offset=0., the required MATLAB commands using mexcdf are simply: mexcdf('open','foo.cdf','nowrite'); elev=mexcdf('varget',cdfid,'elev',[0 0],[-1 -1]); mexcdf('close'); The edges values "-1" means get all the values in this dimension, and scale_factor and add_offset are handled automagically by varget. For more information regarding this software, get the file /pub/mexcdf/README via anonymous ftp from crusty.er.usgs.gov (128.128.19.19) or contact Rich Signell at address@hidden. ______________________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden P.O. Box 3000 http://www.unidata.ucar.edu/ Boulder, CO 80307-3000 ______________________________________________________________________________