cdflib.setVarSparseRecords
指定变量处理稀疏记录的方式
语法
cdflib.getVarSparseRecords(cdfId,varNum,stype)
输入参数
| CDF 文件的标识符,通过调用 | ||||||||
| 标识要设置的变量的数值。变量编号从 0 开始。 | ||||||||
| 以下用于指定变量如何处理稀疏记录的字符向量或字符串标量之一或其等效数值。
要获取这些值的等效数值,请使用 |
示例
打开一个多文件 CDF 文件并关闭变量。
创建一个 CDF 文件,创建一个变量,然后设置该变量的记录类型。要运行此示例,当前必须位于可写文件夹中。
cdfId = cdflib.create("your_file.cdf"); % Create a variable in the file varNum = cdflib.createVar(cdfId,"Time","cdf_int1",1,[],true,[]); % Check the sparse records type of the variable stype = cdflib.getVarSparseRecords(cdfId,varNum)
stype = 'NO_SPARSERECORDS'
% Set the sparse records type of the variable cdflib.setVarSparseRecords(cdfId,varNum,"PAD_SPARSERECORDS") % Check the new sparse records type of the variable stype = cdflib.getVarSparseRecords(cdfId,varNum)
stype = 'PAD_SPARSERECORDS'
%Clean up cdflib.delete(cdfId) clear cdfId
提示
此函数对应于 CDF 库的 C API 例程
CDFsetzVarSparseRecords
。要使用此函数,必须熟悉 CDF C 接口。您可以在 CDF 网站上访问 CDF 文档。