Index exceeds matrix dimensions.
Error in test (line 19) newgreen = c(:,:,2);
I got an error like this while running the below code;
a = imread('lena.tif');%imread(a);
%imgsize = getImgSize('image.jpg')
imshow(a)img = imfinfo('lena.tif')%I = rgb2gray(a);
%figure
%imshow(I)
red = a(:,:,1);imshow(red)green = a(:,:,2);imshow(green)blue = a(:,:,3);imshow(blue)c = horzcat(red,green,blue);imshow(c)newred = c(:,:,1);imshow(red)newgreen = c(:,:,2);%imshow(green)
%newblue = c(:,:,3);
%imshow(blue)
how could i solve this ?
Best Answer