Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

netcdf.inqFormat

Determine format of NetCDF file

Syntax

format = netcdf.inqFormat(ncid)

Description

format = netcdf.inqFormat(ncid) returns the format for the file specified by NetCDF file identifier, ncid.

Input Arguments

ncid

Identifier of a NetCDF file, returned by netcdf.create or netcdf.open, or of a NetCDF group, returned by netcdf.defGrp.

Output Arguments

format

Character vector that specifies the format of the NetCDF file. Returned values include:

FormatDescription
'FORMAT_CLASSIC'Classic format — Original NetCDF format, used by all NetCDF files created between 1989 and 2004
'FORMAT_64BIT'Classic format, 64–bit — Original format with 64–bit addressing capability to allow creation and access of much larger files.
'FORMAT_NETCDF4'Enhanced model, HDF5-based — Introduced in 2008, NetCDF, version 4, extends the classic model and is based on HDF5.
'FORMAT_NETCDF4_CLASSIC' Classic model, HDF5-based — Introduced in 2008, NetCDF, version 4, implements classic model but is based on HDF5.

Examples

This example opens the sample NetCDF file and determines the format.

ncid = netcdf.open('example.nc','NOWRITE');
fmt = netcdf.inqFormat(ncid)

format =

FORMAT_NETCDF4

netcdf.close(ncid);

References

This function corresponds to the nc_inq_format function in the NetCDF library C API.

For copyright information, read the netcdfcopyright.txt and mexnccopyright.txt files.

Was this topic helpful?