Problem reading netCDF-4 files with NC_STRING type

8 visualizaciones (últimos 30 días)
Mathieu
Mathieu el 21 de Mayo de 2019
Editada: Walter Roberson el 29 de Abr. de 2025
I'm running R2019a, and getting an error when trying to read a variable in netCDF file with an xtype of 12. I can read all other variables just fine, but when attempting to read this one variable, I get this message:
"Error using netcdf.getVar (line 137)
12 is not a recognized netCDF datatype."
NC_STRING should be a recognized netCDF external data type. It was introduced back in 2007, with netCDF-4 : https://www.unidata.ucar.edu/software/netcdf/workshops/2007/nc4features/Strings.html
Steps:
[varname,xtype,dimids,natts] = netcdf.inqVar(ncid,4);
>> xtype
xtype =
12
tem=netcdf.getVar(ncid,4);
"Error using netcdf.getVar (line 137)
12 is not a recognized netCDF datatype."

Respuestas (1)

Van Thuan
Van Thuan el 29 de Abr. de 2025
For my case, just updating to Matlab2024b solved this issue.

Community Treasure Hunt

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

Start Hunting!

Translated by