Main Content

Principal component analysis of hyperspectral data

computes the specified number of principal components from the spectral bands of the
hyperspectral data cube. The function returns a new data cube that contains the principal
component bands. The number of spectral bands in the output data cube is equal to the number
of specified principal components `outputDataCube`

= hyperpca(`inputData`

,`numComponents`

)`numComponents`

. To achieve spectral
dimensionality reduction, the specified number of principal components must be less than the
number of spectral bands in the hyperspectral data cube
`inputData`

.

`[`

also returns the principal component coefficients estimated across the spectral dimension of
the hyperspectral data cube.`outputDataCube`

,`coeff`

] = hyperpca(___)

`[`

returns the percentage of variance retained by the principal component bands in addition to
the output arguments mention in the previous syntaxes.`outputDataCube`

,`coeff`

,`var`

] = hyperpca(___)

`[___] = hyperpca(___,`

specifies the principal component analysis (PCA) method and additional options by using the
name-value pair arguments.`Name,Value`

)

**Note**

This function requires the Image Processing Toolbox™ Hyperspectral Imaging Library. You can install the Image Processing Toolbox Hyperspectral Imaging Library from Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.