MATLAB: How to show four sub sections of two images separately in a single window??

how to show the four sub sections of an image???

Img=read('A.jpg');
a=imresize(img,[300 200]);
Img(a)

Best Answer

I=imread('peppers.png');
imshow(I)
%%split the image into four parts
[m,n,p] = size(I) ;
I1 = imcrop(I,[1,1,m/2,n/2]) ;
I2 = imcrop(I,[m/2,1,m,n/2]) ;
I3 = imcrop(I,[1,n/2,m/2,n]) ;
I4 = imcrop(I,[m/2,n/2,m,n]) ;
figure
subplot(221)
imshow(I1)
subplot(222)
imshow(I2)
subplot(223)
imshow(I3)
subplot(224)
imshow(I4)