%% Read ENVI Binary Data File Using Metadata from ENVI Header File
% Read an ENVI header file into the workspace.

info = enviinfo('indian_pines');

% Read from the ENVI binary data file by using the metadata from the ENVI header file.

data = multibandread('indian_pines.dat',...
    [info.Height info.Width info.Bands],...
    info.DataType,info.HeaderOffset,info.Interleave,info.ByteOrder);

% Copyright 2020 The MathWorks, Inc.