www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/SpecifyDataSetToReadExample.m

    %% Specify data set to read
% Call |hdfinfo| to retrieve information about the contents of the HDF
% file.
%%

% Copyright 2015 The MathWorks, Inc.

fileinfo = hdfinfo('sd.hdf')
%%
% Extract the structure containing information about the particular data
% set you want to import from the data returned by
% |hdfinfo|. This example uses the structure in the |SDS| field to retrieve a scientific data set.
sds_info = fileinfo.SDS(2)
%%
% Pass this structure to |hdfread| to import the data in the data set. 
data = hdfread(sds_info);