Main Content

netcdf.inqFormat

Determine format of netCDF file

    Description

    example

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

    Examples

    collapse all

    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