Can not read in a cdf
5 views (last 30 days)
Show older comments
I am rather new to MATLAB and I am trying to read in a cdf file. After downloading a patch, i entered "addpath 'C:\matlab-cdf_patch'" then tried to read in the cdf file with "data=cdfread('test.cdf')"... from there I get the errors:
Undefined function 'cdfinfoc' for input arguments of type 'char'.
Error in cdfinfo (line 165) tmp = cdfinfoc(filename);
Error in cdfread (line 216) info = cdfinfo(filename);
and do not know what they mean. Please help, thank you
0 Comments
Answers (1)
Fangjun Jiang
on 11 Oct 2011
Where did you download the patch? What version of MATLAB are you using? Can you try to run the following command to see if there is any error?
which example.cdf -all;
cdfinfo('example.cdf');
data=cdfread('example.cdf')
2 Comments
Fangjun Jiang
on 12 Oct 2011
MATLAB provides a cdfread() function. I don't know why do you need to download a patch from NASA website. Remove your 'C:\matlab-cdf_patch' folder from your MATLAB path to see if you already have the cdfread() function by typing
which cdfread -all
The 'example.cdf' file is provided by MATLAB too. I was trying to tell you to go through that example to see if cdfread() can read it correctly. Here is a link to the document of cdfread(). http://www.mathworks.com/help/techdoc/ref/cdfread.html. It was available at least in R2007b. You can get that help by typing help cdfread.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!