```Matlab
clear
close all
b1=imread('Fig1138(a)(WashingtonDC_Band1_564).tif');
b2=imread('Fig1138(b)(WashingtonDC_Band2_564).tif');
b3=imread('Fig1138(c)(WashingtonDC_Band3_564).tif');
b4=imread('Fig1138(d)(WashingtonDC_Band4_564).tif');
b5=imread('Fig1138(e)(WashingtonDC_Band5_564).tif');
b6=imread('Fig1138(f)(WashingtonDC_Band6_564).tif');
s= cat(3, b1,b2,b3,b4, b5, b6);
[X, R]= imstack2vectors(s);
P= princomp(X,6);
g1= P.Y(:,1);
g1= reshape(g1, 564, 564);
figure,imshow(b1);
figure,imshow(g1, []);
d=diag(P.Cy);
g2= P.Y(:,2);
g2= reshape(g2, 564, 564);
figure,imshow(b2);
figure,imshow(g2, []);
g3= P.Y(:,3);
g3= reshape(g3, 564, 564);
figure,imshow(b3);
figure,imshow(g3, []);
g4= P.Y(:,4);
g4= reshape(g4, 564, 564);
figure,imshow(b4);
figure,imshow(g4, []);
g5= P.Y(:,5);
g5= reshape(g5, 564, 564);
figure,imshow(b5);
figure,imshow(g5, []);
g6= P.Y(:,6);
g6= reshape(g6, 564, 564);
figure,imshow(b6);
figure,imshow(g6, []);
cat函数
Concatenation for heterogeneous arrays
不同数组/阵列的连接
Syntax
C = cat(dim,A,B)
## princomp函数 &covmatrix函数##
由于我使用的是冈萨雷斯的书籍,发现princomp函数与Matlab自身提供的函数不同,所以请将原来书本的代码复制到新的路径下,run即可。
由于原图是tif格式,本网站暂不支持tif格式的图像上传,故不在此发图。