%% Create Contrast-Stretched RGB Image of Hyperspectral Data
% Read a hyperspectral data into the workspace.

hcube = hypercube('paviaU.dat');

% Estimate an RGB image of the hyperspectral data. Increase the image contrast by applying contrast stretching.

coloredImg = colorize(hcube,"Method","rgb","ContrastStretching",true);

% Display the contrast-stretched RGB image.

imshow(coloredImg)

% Copyright 2020 The MathWorks, Inc.