cdflib.closeVar

Close specified variable from multifile format Common Data Format (CDF) file

Syntax

cdflib.closeVar(cdfId,varNum)

Description

cdflib.closeVar(cdfId,varNum) closes a variable in a multifile format CDF.

cdfId identifies the CDF file and varNum is a numeric value that specifies the variable. Variable identifiers (variable numbers) are zero-based.

For multifile CDFs, you must close all open variable files to guarantee that all modifications you have made are actually written to the CDF file(s). You do not need to call this function for variables in a single-file format CDF.

Examples

Create a multifile CDF, create a variable, and then close the variable. To run this example, you must be in a writable folder.

cdfid = cdflib.create('your_multifile.cdf');

% Make it a multifile format CDF
cdflib.setFormat(cdfid,'MULTI_FILE')

% Create a variable in the CDF.
varNum = cdflib.createVar(cdfid,'Time','cdf_int1',1,[],true,[]);

%  Close the variable.
cdflib.closeVar(cdfid, varnum)

% Clean up
cdflib.delete(cdfid)
clear cdfid

References

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

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.