Clear Filters
Clear Filters

how to access .cdf file

16 views (last 30 days)
neetasha arya
neetasha arya on 8 Mar 2021
Commented: on 29 Aug 2022
I am using matlab R2020a in windows 10 pro.
I have downloaded data from (/mms/sdc/public/data/mms1/fgm/brst) data science centre and i want to open it.
I am using data = cdfread(); syntax for this purpose as given in the matlab documentation but error is occuring as,
"Error using cdfread (line 149). Unable to open file. File might be corrupt or filename might have unsupported characters."
Similarly If I use [data,info] = cdfread();, the error occuring is as follows:
"Error using cdflibmex
33 is not a recognized DATATYPE mode.
Error in cdflib.inquireVar (line 28)
[name,dtype,nelts,dims,recVary,dimVary] = cdflibmex('inquireVar',cdfId,varNum);
Error in cdfread>read_data_by_hyperslab (line 357)
varinfo = cdflib.inquireVar(cdfid,varnum);
Error in cdfread>read_data (line 209)
data = read_data_by_hyperslab(cdfid,options);
Error in cdfread (line 172)
data = read_data(cdfid,options);"
Please help me out with this issue, if possible!

Answers (1)

Rashed Mohammed
Rashed Mohammed on 11 Mar 2021
Hi Neetasha
As of R2021a, reading CDF files which use CDF_TIME_TT2000 (datatype 33) is not supported. However, you can use the spdfcdfread function present in the patch provided by NASA for reading the CDF files you have. Download and install the patch. Add the installation folder to the path of MATLAB using addpath function.
Hope this helps.
neetasha arya
neetasha arya on 29 Mar 2021
Hello Rashed,
I followed the above solution given by you and now I am able to open the cdf file.
Thanks for the help!
on 29 Aug 2022
Hello Rashed,
I follow the above solution, but there are still errors.
Error in spdfcdfinfoc
Error issued from CDF library: "NO_SUCH_CDF: The specified CDF does not exist."
Error in spdfcdfinfo (line 359)
tmp = spdfcdfinfoc(filename, args.VarStruct, args.Variables, args.Validate);
Error in spdfcdfread (line 384)
info = spdfcdfinfo(filename, 'VALIDATE', args.Validate);
Please help me out with this issue, if possible!

Sign in to comment.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!