MATLAB Answers

PCA on a 3d Matrix

57 views (last 30 days)
Micheal Dennington
Micheal Dennington on 20 Jun 2020
Answered: Subhadeep Koley on 16 Nov 2020
Hi. I have a data set of http://www.ehu.eus/ccwintco/index.php/Hyperspectral_Remote_Sensing_Scenes Indian Pines. Data set is a 145x145x200 matrix that 145x145 represents spatial dimensions, 200 represents feature dimensions. I wnat to do PCA dimension reduction but I can't figure out how to deal 3d matrix. If you could help me I would be appreciated. Thanks.

  2 Comments

Micheal Dennington
Micheal Dennington on 21 Jun 2020
Yeah I saw that example but I couldn't understand that very much.

Sign in to comment.

Answers (1)

Subhadeep Koley
Subhadeep Koley on 16 Nov 2020
You can use the hyperpca function to achieve the same.
% Definenumber of principal components you require
numComponents = 10;
% Perform PCA transform
outputDataCube = hyperpca(indianPinesMatrix, numComponents);
The above mentioned feture comes under Image Processing Toolbox's Hyperspectral Imaging Library support package, and can be downloaded from here. For more information on Hyperspectral Imaging Library see the documentation.

  0 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!