I wrote the code for it . I can divide the left side of an image and while doing for the right side left part of it is black and right part is the second half of the image . The problem where i am facing is , in the 2nd for loop it starts with k=1 n m=110 so for others column values from 1 to 109 as a default its taking zero. How to sort out this problem.
% code
x=imread('img1.jpg');image=rgb2gray(x);[q r]=size(image);s=r/2;for i=1:q for j=1:s n1(i,j)=image(i,j); endendfor k=1:q for m=s:r n2(k,m)=image(k,m); endendimshow(n1)figureimshow(n2) end
Best Answer