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.


Information about variable


info = cdflib.inquireVar(cdfId,varNum)


info = cdflib.inquireVar(cdfId,varNum) returns information about a variable in a Common Data Format (CDF) file.

Input Arguments


Identifier of a CDF file, returned by a call to cdflib.create or


Numeric value that identifies the variable. Variable numbers are zero-based.

Output Arguments


Structure containing the following fields.

nameName of the variable
datatypeData type
numElementsNumber of elements of the datatype
dimsSizes of the dimensions
recVarianceRecord variance
dimVarianceDimension variances

Record and dimension variances affect how the library physically stores variable data. For example, if a variable has a record variance of VARY, the library physically stores each record. If the record variance is NOVARY, the library only stores one record.


Open the example CDF file and get information about a variable.

cdfid ='example.cdf');

% Determine if the file contains variables 
info  = cdflib.inquireVar(cdfid,1)

info = 

           name: 'Longitude'
       datatype: 'cdf_int1'
    numElements: 1
           dims: [2 2]
    recVariance: 0
    dimVariance: [1 0]


This function corresponds to the CDF library C API routine CDFinquirezVar.

To use this function, you must be familiar with the CDF C interface. Read the CDF documentation at the CDF website.

For copyright information, see the cdfcopyright.txt file.

Was this topic helpful?