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.


Write hyperslab of data to variable




cdflib.hyperPutVarData(cdfId,varNum,recSpec,dimSpec,data) writes a hyperslab of data to a variable in a Common Data Format (CDF) file. Hyper access allows more than one value to be read from or written to a variable with a single call to the CDF library.

Input Arguments


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


Specifies the variable containing the datum.


Three-element array described by [RSTART RCOUNT RSTRIDE], where RSTART, RCOUNT, and RSTRIDE are scalar values giving the start, number of records, and sampling interval (or stride) between records. Record indices are zero-based.


Three-element cell array described by {DSTART DCOUNT DSTRIDE}, where DSTART, DCOUNT, and DSTRIDE are n-element vectors that describe the start, number of values along each dimension, and sampling interval along each dimension. If the hyperslab has zero dimensions, you can omit this parameter. Dimension indices are zero-based.


Data to write to the variable.


Create a CDF, create a variable, and then write a slab of data to 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,'Grades','cdf_int1',1,[],true,[]);

% Write data to the variable

%Clean up
clear cdfid


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

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?