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 Common Data Format (CDF) file


info = cdfinfo(filename)


info = cdfinfo(filename) returns information about the Common Data Format (CDF) file specified in the string filename.

    Note   Because cdfinfo creates temporary files, the current working directory must be writeable.

The following table lists the fields returned in the structure, info. The table lists the fields in the order that they appear in the structure.




Text string specifying the name of the file


Text string indicating the date the file was last modified


Double scalar specifying the size of the file, in bytes


Text string specifying the file format


Text string specifying the version of the CDF library used to create the file


Structure array containing library settings used to create the file


Filenames containing the CDF file's data, if it is a multi-file format CDF


N-by-6 cell array, where N is the number of variables, containing information about the variables in the file. The columns present the following information:

Column 1

Text string specifying name of variable

Column 2

Double array specifying the dimensions of the variable, as returned by the size function

Column 3

Double scalar specifying the number of records assigned for the variable

Column 4

Text string specifying the data type of the variable, as stored in the CDF file

Column 5

Text string specifying the record and dimension variance settings for the variable. The single T or F to the left of the slash designates whether values vary by record. The zero or more T or F letters to the right of the slash designate whether values vary at each dimension. Here are some examples.

T/  (scalar variable 
F/T (one-dimensional variable)

T/TFF (three-dimensional variable)


Structure array that contains one field for each global attribute. The name of each field corresponds to the name of an attribute. The data in each field, contained in a cell array, represents the entry values for that attribute.


Structure array that contains one field for each variable attribute. The name of each field corresponds to the name of an attribute. The data in each field is contained in a n-by-2 cell array, where n is the number of variables. The first column of this cell array contains the variable names associated with the entries. The second column contains the entry values.

    Note   Attribute names returned by cdfinfo might not match the names of the attributes in the CDF file exactly. Attribute names can contain characters that are illegal in MATLAB® field names. cdfinfo removes illegal characters that appear at the beginning of attributes and replaces other illegal characters with underscores ('_'). When cdfinfo modifies an attribute name, it appends the attribute's internal number to the end of the field name. For example, the attribute name Variable%Attribute becomes Variable_Attribute_013.

    Note:   To improve performance, turn off the file validation which the CDF library does by default when opening files. For more information, see cdflib.setValidate.


collapse all

Get information about the sample file, example.cdf.

info = cdfinfo('example.cdf')
info = 

  struct with fields:

              Filename: 'example.cdf'
           FileModDate: '10-May-2010 21:35:00'
              FileSize: 1310
                Format: 'CDF'
         FormatVersion: '2.7.0'
          FileSettings: [1×1 struct]
              Subfiles: {}
             Variables: {6×6 cell}
      GlobalAttributes: [1×1 struct]
    VariableAttributes: [1×1 struct]

View information about the variables in the file.

ans =

  6×6 cell array

  Columns 1 through 5

    'Time'                [1×2 double]    [24]    'epoch'     'T/'    
    'Longitude'           [1×2 double]    [ 1]    'int8'      'F/FT'  
    'Latitude'            [1×2 double]    [ 1]    'int8'      'F/TF'  
    'Data'                [1×3 double]    [ 1]    'double'    'T/TTT' 
    'multidimensional'    [1×4 double]    [ 1]    'uint8'     'T/TTTT'
    'Temperature'         [1×2 double]    [10]    'int16'     'T/TT'  

  Column 6


Introduced before R2006a

Was this topic helpful?