h5read函数是MATLAB中用于读取HDF5文件数据的标准函数。对于HDF4文件,虽然MATLAB也提供了支持,但你可能需要使用不同的函数或工具,如hdfread函数。 指定要读取的数据集名称或路径: 在HDF文件中,数据通常存储在不同的数据集中。你需要知道要读取的数据集的名称或路径,并将其作为h5read函数的参数。 (可选)对读取的数据...
或者通过在命令窗口输入:hdftool(example.hdf),也可打开在MATLAB路径下文件名为‘example.hdf’的HDF文件。由于是可视化的工具,所以能够很直观的显示HDF文件,而且将数据输出的操作简单易行。 2)使用信息读取函数hdfinfo 通过在MATLAB中使用hdfinfo这个函数,可以获得HDF文件的信息,其语法为: S= hdfinfo(filename)或S...
%read-read access ,create-create a new access ,rdwr or write-read and write %access %---step two---find the information [ndatasets,nglobal_attr,status] = hdfsd('fileinfo',sd_id); % HDF4 file contains ndatasets data sets and nglobal_attr global attribute. % status 表示状态 vaule=-...
For HDF4 files,idxcorresponds to the reference number of the image to read. Reference numbers do not necessarily correspond to the order of the images in the file. You can useimfinfoto match image order with reference number. Example:2 ...
本文首先介绍了HDF文件格式,以及几种常用的HDF文件读取方式和各自的优缺点。在此基础上,详细给出了MATLAB读取HDF文件的简易方法和代码。最后,本文给出了利用MATLAB读取NCEP数据的应用实例。关键词 HDF格式,MATLAB,科学数据A practical way to read HDF data with MATLABBai Long1、Lei Hui2、Zhang Xuan2(1.Nanjing...
读取数据,需要打开HDF文件,选取数据集,读取数据集中 的数据,最后关闭文件这样一系列的操作过程,但是hdfread 函数已经把这些所有的过程都包括在内了。因此使用起来相 对简单一些。hdfread函数的常用法是: data=hdfread(filename,dataset); 其中data返回指定数据集中的所有数据,dataset的 ...
% Read data set named 'Example SDS' data = hdfread('example.hdf','Example SDS'); Example 2: % Retrieve info about example.hdf fileinfo = hdfinfo('example.hdf'); % Retrieve info about Scientific Data Set in example.hdf data_set_info = fileinfo.SDS; % Check the size data_set_info...
read 表示读文件。 其次, 要选择数据集, 用 sds_id = hdfsd ( - select. , sd_id , sds_idx ) ; sds_id 将在下面的用法中代表所打开的数据集, 它是要打开的数据集在HDF 文件中的索引号。然后是最 重要的一步, 从数据集中读文件, 语法为: 677 6 期 陈 林等: Mat lab 对基于HDF 格式的MODIS...
MATLAB读HDF数据(转载) hdf (hierarchical data format) 中文可译为分级数据格式,卫星资料多用这种形势存储。 %---step one---open file s='D:\parter\ben\QS_XWGRD3_2006192.20070991754'; sd_id = hdfsd('start',s,'read'); % sd_id is the identifier of SDfile %read-read access,create-create...
'数据集名');1例如:raw = h5read('dataset/sample_A_padded_20160501.hdf',' /volumes/raw ');13. 读取数据集的属性attribute = h5readatt('文件名.hdf','数据集名','属性名');1例如:resolution = h5readatt('dataset/sample_A_padded_20160501.hdf','/volumes/raw','resolution');14...