Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

NetCDF 文件

网络通用数据格式

使用 MATLAB® 高级函数或包含低级函数的 netCDF 库程序包读取或写入 netCDF 文件。高级函数简化了从 netCDF 文件读取数据或将变量从 MATLAB 工作区写入 netCDF 文件的过程。

为了对读写过程进行更多控制,请使用包含低级函数的 NetCDF 库程序包。低级函数让您能够访问 NetCDF C 库中的例程,从而可以对读写过程进行更多控制。

MATLAB 支持 netCDF 版本 4.8.1。

函数

全部展开

nccreate在 netCDF 文件中创建变量
ncdisp在命令行窗口中显示 NetCDF 数据源内容
ncinfo 返回有关 NetCDF 数据源的信息
ncread读取 NetCDF 数据源中的变量数据
ncreadatt读取 NetCDF 数据源中的属性值
ncwrite将数据写入 NetCDF 文件
ncwriteatt将属性写入 NetCDF 文件
ncwriteschema将 NetCDF 架构定义添加到 NetCDF 文件中

库函数

netcdf.getChunkCache检索 NetCDF 库的区块缓存设置
netcdf.inqLibVers返回 NetCDF 库版本信息
netcdf.setChunkCache设置 NetCDF 库的默认分块缓存设置
netcdf.setDefaultFormat更改默认 netCDF 文件的格式

文件操作

netcdf.abort还原最近的 netCDF 文件定义
netcdf.close关闭 netCDF 文件
netcdf.create创建新的 netCDF 数据集
netcdf.endDef结束 netCDF 文件定义模式
netcdf.inq返回有关 netCDF 文件的信息
netcdf.inqFormat确定 NetCDF 文件的格式
netcdf.inqGrps检索子组 ID 数组
netcdf.inqUnlimDims检索组中无限维度列表
netcdf.open打开 NetCDF 数据源
netcdf.reDef让打开的 netCDF 文件进入定义模式
netcdf.setFill设置 netCDF 填充模式
netcdf.sync将 netCDF 文件同步到磁盘

维度

netcdf.defDim创建 netCDF 维度
netcdf.inqDim返回 netCDF 维度名称和长度
netcdf.inqDimID返回维度 ID
netcdf.renameDim更改 netCDF 维度名

netcdf.defGrp在 NetCDF 文件中创建组
netcdf.inqDimIDs检索组中维度标识符列表
netcdf.inqGrpName检索组名
netcdf.inqGrpNameFull组的完整路径名
netcdf.inqGrpParent检索父组的 ID。
netcdf.inqNcid返回已命名组的 ID
netcdf.inqVarIDs组中所有变量的 ID

变量

netcdf.defVarFill定义 NetCDF 变量的填充参数
netcdf.defVar创建 NetCDF 变量
netcdf.defVarChunking定义 NetCDF 变量的分块行为
netcdf.defVarDeflate定义 NetCDF 变量的压缩参数
netcdf.defVarFletcher32定义 NetCDF 变量的校验参数
netcdf.getVar读取 NetCDF 变量中的数据
netcdf.inqVar有关变量的信息
netcdf.inqVarChunking确定 NetCDF 变量的分块设置
netcdf.inqVarDeflate确定 NetCDF 变量的压缩设置
netcdf.inqVarFill确定 NetCDF 变量的填充参数值
netcdf.inqVarFletcher32关于 NetCDF 变量的 Fletcher32 校验和设置
netcdf.inqVarID返回与变量名相关联的 ID
netcdf.putVar将数据写入 netCDF 变量
netcdf.renameVar更改 netCDF 变量名

属性

netcdf.copyAtt将属性复制到新位置
netcdf.delAtt删除 netCDF 属性
netcdf.getAtt返回 NetCDF 属性
netcdf.inqAtt返回有关 netCDF 属性的信息
netcdf.inqAttID返回 netCDF 属性的 ID
netcdf.inqAttName返回 netCDF 属性名称
netcdf.putAtt写入 netCDF 属性
netcdf.renameAtt更改属性名称

用户定义的类型

netcdf.defVlenDefine user-defined variable length array type (NC_VLEN)
netcdf.inqUserTypeReturn information about user-defined type
netcdf.inqVlenReturn information about user-defined NC_VLEN type

实用工具

netcdf.getConstant返回命名常量的数值
netcdf.getConstantNames返回 netCDF 库已知的常量列表

主题

疑难解答

Resolve Errors Reading OPeNDAP Data

When you have trouble reading OPeNDAP data, consider these factors.

相关信息