1个回答
更多追问追答
追问
差不多吧,我用for 循环加eval函数分出来了,不过还是想看看你的代码是不是更简便~
追答
clear;
clc;
filename='C:\Users\ADMINI~1\Desktop\pic.jpg';
A=imread(filename);
[m,n,l] = size(A);
for i=1:5
for j=1:5
m_start=1+(i-1)*fix(m/5);
m_end=i*fix(m/5);
n_start=1+(j-1)*fix(n/5);
n_end=j*fix(n/5);
B(:,:,:,i,j)=A(m_start:m_end,n_start:n_end,:);
end
end
for i = 1:5
for j=1:5
subplot(5,5,(i-1)*5+j);
imshow(B(:,:,:,i,j));
text(10,10,['A' num2str(i) num2str(j)],'Color','white','FontSize',14,'FontWeight','Bold');
end
end
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询