NASA Logo, National Aeronautics and Space Administration

CDF Patch for Matlab for Version R2007a and later

If you get error messages reading a CDF file or are not happy with CDF file reading time, we strongly encourage you to download the patch on this page. The patch fixes a lot of problems (see below for details), and it's significantly faster than the cdfread function supplied in all Matlab releases (including Matlab R2007b). Our performance test against a CDF file from the ulysses mission brought the reading time down to 8 seconds from 10 minutes. Please note: this patch applies only for Matlab version R2007a and later.  CDF logo

The patch available on this page has been sent to the Matlab development team for inclusion into a future Matlab release.

What's Included in the Patch

Download and Installation Instructions

Last patch creation date: July 15, 2009 with CDF Version 3.3.0. From CDF V3.3.0, you can enter "cdfinfo()" within matlab to see the library and patch versions.  CDF logo

Windows:

  1. Download the self-extracting file: matlab_cdf_patch for Windows.
  2. Double-click the downloaded file to extract the files included in the patch.
  3. Invoke Matlab and issue the following command at the Matlab prompt:

    addpath '<patch_install_dir>'

    For example, if the patch is installed under C:\matlab_cdf_patch, the command should be

    addpath 'C:\matlab_cdf_patch'

  4. Use Matlab as usual (e.g. data=cdfread('test.cdf','combinerecords', true)).

Mac OS X:

  1. Download the disk image file: matlab_cdf_patch for Mac OS X.
  2. Move the Matlab_CDF_Patch directory in the downloaded file to the directory you want the patch to be installed under.
  3. Invoke Matlab and issue the following command at the Matlab prompt:

    addpath '<patch_install_dir>'

    For example, if the patch is installed under /Users/davidh, the command should be

    addpath '/Users/davidh/Matlab_CDF_Patch'

  4. Use Matlab as usual (e.g. data=cdfread('test.cdf','combinerecords', true)).

Linux / Solaris:

  1. Download one of the following tar files:

  2. Go to the directory where you want the patch to be installed under.
  3. Extract the files in the patch using the following command:

    tar xvf <downloaded tar file>

  4. Invoke Matlab and issue the following command at the Matlab prompt:

    addpath '<patch_install_dir>'

    For example, if the patch is installed under /home/davidh, the command should be

    addpath '/home/davidh/matlab_cdf_patch'

  5. Use Matlab as usual (e.g. data=cdfread('test.cdf','combinerecords', true)).

If you have any questions or encounter problems, please send an email to cdfsupport@listserv.gsfc.nasa.gov and we'll respond as soon as possible.

NASA Logo - nasa.gov