Main Content

netcdf.inqVarFill

Return fill parameters for netCDF variable

    Description

    example

    [noFillMode,fillValue] = netcdf.inqVarFill(ncid,varid) returns the fill parameters for the netCDF variable specified by varid in the file or group specified by ncid.

    Examples

    collapse all

    Open the sample netCDF file, and get the fill parameters for a variable. In this case, the specified variable has fill mode enabled and a fill value of -32767.

    ncid = netcdf.open("example.nc","NOWRITE");
    varid = netcdf.inqVarID(ncid,"temperature");
    [noFillMode,fillValue] = netcdf.inqVarFill(ncid,varid)
    
    noFillMode =
    
      logical
    
       0
    
    
    fillValue =
    
      int16
    
       -32767
    

    Close the netCDF file.

    netcdf.close(ncid)
    

    Input Arguments

    collapse all

    NetCDF file or group identifier, specified as a nonnegative integer scalar. You can use the netcdf.create or netcdf.open function to return a file identifier. You can use the netcdf.defGrp function to return a group identifier.

    Data Types: double

    NetCDF variable identifier, specified as a nonnegative integer scalar. You can use the netcdf.defVar function to return a variable identifier.

    Data Types: double

    Output Arguments

    collapse all

    Status of fill mode, returned as a 1 or 0 of data type logical. A value of 1 indicates that fill mode is not enabled for the specified variable.

    Fill value for missing values, returned as a scalar.

    Tips

    • This function corresponds to the nc_inq_var_fill function in the netCDF library C API.

    Version History

    Introduced in R2010b