Main Content

netcdf.inqFormat

Determine format of NetCDF file

    Description

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

    Examples

    Determine Format of NetCDF file

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

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

    Input Arguments

    collapse all

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

    Data Types: double

    Output Arguments

    collapse all

    Format of the NetCDF file, returned as one of the following values.

    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.

    Version History

    Introduced in R2010b