高光谱图像降维matlab代码

求使用PCA和低秩张量分解的方法对高光谱图像降维的matlab代码,谢谢大家

使用MATLAB对PaviaU数据集进行PCA降维,降为三维

P=load('PaviaU.mat');
[m,n,band]=size(P.paviaU);
ReshapedP=reshape(P.paviaU,m*n,band);
[coeff,score,latent,tsquared] = pca(ReshapedP);
percent=cumsum(latent)./sum(latent);
disp(percent);
feature_after_PCA=score(:,1:3);
RES=reshape(feature_after_PCA,m,n,3);
subplot(131);imshow(RES(:,:,1));
subplot(132);imshow(RES(:,:,2));
subplot(133);imshow(RES(:,:,3));