%% Create Hypercube Object from Data Cube and Wavelength Values
% Load .mat file that contain the data cube and the wavelength values. The .mat file contains Indian pines data collected using AVIRIS sensor.

data = load('indian_pines.mat');

% Inspect the data read from the .mat file. The data contains a 3-D numeric array that specifies the data cube values and wavelenghts of spectral bands in the data cube. In addition, the data also contains the endmember signatures of Indian pines data.

data

% Create a hypercube object by passing the data cube and the wavelength values.

hcube = hypercube(data.indian_pines,data.wavelengths);

% Inspect the properties of the hypercube object.

hcube

% Visualize the RGB version of the data cube. Derive the RGB image by using colorize function.

rgbImg = colorize(hcube,'Method','RGB');
figure
imagesc(rgbImg)

% Inspect the metadata to know information related to the hyperspectral data.

hcube.Metadata

% Copyright 2020 The MathWorks, Inc.