CDF Patch for MATLAB
If you are using MATLAB version R2007b and earlier, and you are getting error messages reading a CDF file or are not happy with CDF file
reading performance, 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.
The patch available on this page had been sent to the MATLAB development
team for inclusion into their future MATLAB releases.
If you're using newer version of MATLAB, you may consider using this patch as it is built with the latest CDF distribution.
What's Included in the Patch
- The cdfread routine occasionally chokes on some CDF files and issues
an error message "Undefined function or method 'rdivide' for input arguments of type 'cell'.".
- The cdfinfo and cdfread routines do not understand the CDF_EPOCH16
data type and issue an error message.
- The cdfread routine doesn't properly handle an array of CDF_EPOCH values.
- The cdfread routine reads one record at a time instead of reading
all the records in one scoop/read. As a result, the variable data
reading time, if there are a lot of records to read, will take a long
time that may not be acceptable to many users.
Download and Installation Instructions
Last patch creation date: Novermber 23, 2008 with CDF Version
3.2.3
Windows:
- Download matlab_cdf_patch.exe.
- Double-click the downloaded patch to extract the files included
in the patch.
- 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'
- Use MATLAB as usual (e.g. data=cdfread('test.cdf')).
Mac OS X:
- Download one of the followings:
- Move the MATLAB_CDF_Patch directory in the downloaded patch to the directory you want it installed under.
- Invoke MATLAB and issue the following command at the MATLAB prompt:
addpath '<patch_install_dir>'
For example, if the patch is installed under /Users/cdf, the
command should be
addpath '/Users/cdf/MATLAB_CDF_Patch'
- Use MATLAB as usual (e.g. data=cdfread('test.cdf')).
Linux / Solaris:
- Download one of the followings:
- Go to the directory where want the patch to be installed under.
- Extract the files in the patch using the following command:
tar xvf matlab_cdf_patch.tar
- Invoke MATLAB and issue the following command at the MATLAB prompt:
addpath '<patch_install_dir>'
For example, if the patch is installed under /home/cdf, the
command should be
addpath '/home/cdf/matlab_cdf_patch'
- Use MATLAB as usual (e.g. data=cdfread('test.cdf')).
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.