Skip to Main Content Skip to Search
Product Documentation

cdflib.setVarBlockingFactor - Specify blocking factor for variable

Syntax

cdflib.setVarBlockingFactor(cdfId,varNum,blockingFactor)

Description

cdflib.setVarBlockingFactor(cdfId,varNum,blockingFactor) specifies the blocking factor for a variable in a Common Data Format (CDF) file.

Input Arguments

cdfId

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

varNum

Numeric value identifying a variable in the file. Variable numbers are zero-based.

blockingFactor

Numeric value that specifies the number of records to allocate when writing to an unallocated record.

Definitions

blocking factor

A variable's blocking factor specifies the minimum number of records the library allocates when you write to an unallocated record. If you specify a fractional blocking factor, the library rounds the value down.

Examples

Create a CDF, create a variable in the CDF, and then set the blocking factor used with the variable. To run this example, you must be in a writable folder.

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

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

% Get the current blocking factor used with the variable 
bFactor = cdflib.getVarBlockingFactor(cdfid,varNum)

bFactor =

    0

% Change the blocking factor for the variable
cdflib.setVarBlockingFactor(cdfid,varNum,10);

% Check the new blocking factor .
bFactor = cdflib.getVarBlockingFactor(cdfid,varNum)

bFactor =

    10

%  Clean up
cdflib.delete(cdfid)

clear cdfid

References

This function corresponds to the CDF library C API routine CDFsetzVarBlockingFactor. To use this function, you must be familiar with the CDF C interface. Read the CDF documentation at the CDF Web site. For copyright information, see the cdfcopyright.txt file.

See Also

cdflib.getVarBlockingFactor

Tutorials

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS