Skip to Main Content Skip to Search
Product Documentation

netcdf - Summary of MATLAB Network Common Data Form (NetCDF) capabilities

Description

MATLAB provides both high- and low-level access to NetCDF files:

High-Level Access

These functions provide high-level access to NetCDF files.

nccreateCreate variable in NetCDF file
ncdisp Display contents of NetCDF data source in Command Window
ncinfo Return information about NetCDF data source
ncreadRead data from variable in NetCDF data source
ncreadatt Read attribute value from NetCDF data source
ncwrite Write data to NetCDF file
ncwriteattWrite attribute to NetCDF file
ncwriteschemaAdd NetCDF schema definitions to NetCDF file

Low-Level Access

The MATLAB low-level functions provide an API that you can use to enable reading data from and writing data to NetCDF files (known as data sets in NetCDF terminology). To use these functions, you should be familiar with the information about NetCDF contained in the NetCDF C Interface Guide.

MATLAB supports NetCDF version 4.1.2.

In most cases, the syntax of the MATLAB function matches the syntax of the NetCDF library function. The functions are implemented as a package called netcdf. To use these functions, prefix the function name with package name netcdf. For example, to call the NetCDF library routine used to open existing NetCDF files, use the following MATLAB syntax:

ncid = netcdf.open(ncfile, mode);

Library Functions

netcdf.setChunkCache Set default chunk cache settings for NetCDF library
netcdfSummary of MATLAB Network Common Data Form (NetCDF) capabilities
netcdf.getChunkCache Retrieve chunk cache settings for NetCDF library
netcdf.inqLibVersReturn NetCDF library version information
netcdf.setDefaultFormatChange default netCDF file format

File Operations

netcdf.abortRevert recent netCDF file definitions
netcdf.closeClose netCDF file
netcdf.createCreate new NetCDF dataset
netcdf.endDefEnd netCDF file define mode
netcdf.inq Return information about netCDF file
netcdf.inqFormat Determine format of NetCDF file
netcdf.inqGrps Retrieve array of child group IDs
netcdf.inqUnlimDimsReturn list of unlimited dimensions in group
netcdf.openOpen NetCDF data source
netcdf.reDefPut open netCDF file into define mode
netcdf.setFillSet netCDF fill mode
netcdf.syncSynchronize netCDF file to disk

Dimensions

netcdf.defDimCreate netCDF dimension
netcdf.inqDimReturn netCDF dimension name and length
netcdf.inqDimIDReturn dimension ID
netcdf.renameDimChange name of netCDF dimension

Variables

netcdf.defVarFill Define fill parameters for NetCDF variable
netcdf.inqVarDeflateDetermine compression settings for NetCDF variable
netcdf.defVarCreate NetCDF variable
netcdf.defVarChunking Define chunking behavior for NetCDF variable
netcdf.defVarDeflateDefine compression parameters for NetCDF variable
netcdf.defVarFletcher32 Define checksum parameters for NetCDF variable
netcdf.getVarReturn data from netCDF variable
netcdf.inqVarReturn information about variable
netcdf.inqVarChunking Determine chunking settings for NetCDF variable
netcdf.inqVarFill Determine values of fill parameters for NetCDF variable
netcdf.inqVarFletcher32 Fletcher32 checksum setting for NetCDF variable
netcdf.inqVarIDReturn ID associated with variable name
netcdf.putVarWrite data to netCDF variable
netcdf.renameVarChange name of netCDF variable

Attributes

netcdf.copyAttCopy attribute to new location
netcdf.delAttDelete netCDF attribute
netcdf.getAttReturn netCDF attribute
netcdf.inqAttReturn information about netCDF attribute
netcdf.inqAttIDReturn ID of netCDF attribute
netcdf.inqAttNameReturn name of netCDF attribute
netcdf.putAttWrite netCDF attribute
netcdf.renameAttChange name of attribute

Utilities

netcdf.getConstantReturn numeric value of named constant
netcdf.getConstantNamesReturn list of constants known to netCDF library
  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS