<>程序中用细胞数组,这是我这几天遇到的提取100幅图片信息的程序,图片的大小不同,就要用细胞数组来存储</P><>clear</P><>a={'A.bmp','A1.bmp','A2.bmp','A3.bmp','A4.bmp','A5.bmp','A6.bmp','A7.bmp','A8.bmp','A9.bmp','A10.bmp',...
'A11.bmp','A12.bmp','A13.bmp','A14.bmp','A15.bmp','A16.bmp','A17.bmp','A18.bmp','A19.bmp','A20.bmp',...
'A21.bmp','A22.bmp','A23.bmp','A24.bmp','A25.bmp','A26.bmp','A27.bmp','A28.bmp','A29.bmp','A30.bmp',...
'A31.bmp','A32.bmp','A33.bmp','A34.bmp','A35.bmp','A36.bmp','A37.bmp','A38.bmp','A39.bmp','A40.bmp',...
'A41.bmp','A42.bmp','A43.bmp','A44.bmp','A45.bmp','A46.bmp','A47.bmp','A48.bmp','A49.bmp','A50.bmp',...
'A51.bmp','A52.bmp','A53.bmp','A54.bmp','A55.bmp','A56.bmp','A57.bmp','A58.bmp','A59.bmp','A60.bmp',...
'A61.bmp','A62.bmp','A63.bmp','A64.bmp','A65.bmp','A66.bmp','A67.bmp','A68.bmp','A69.bmp','A70.bmp',...
'A71.bmp','A72.bmp','A73.bmp','A74.bmp','A75.bmp','A76.bmp','A77.bmp','A78.bmp','A79.bmp','A80.bmp',...
'A81.bmp','A82.bmp','A83.bmp','A84.bmp','A85.bmp','A86.bmp','A87.bmp','A88.bmp','A89.bmp','A90.bmp',...
'A91.bmp','A92.bmp','A93.bmp','A94.bmp','A95.bmp','A96.bmp','A97.bmp','A98.bmp','A99.bmp'};</P><P>for i=1:length(a)
[I map]=imread(a{1,i});
I;b=1;
for j=1:511
for k=1:511
if (I(j,k)==1&&I(j,k+1)==0)||(I(j,k)==0&&I(j,k+1)==1)
x(1,b)=k;
y(1,b)=j;
b=b+1;
end
end
end
w=i*ones(1,length(x));
zz1{1,i}=x;
zz1{2,i}=y;
zz1{3,i}=w;
I=[];x=[];y=[];w=[];
end</P> |