MATLAB: Index exceeds matrix dimensions.

dimension

img=('frame1.jpg');
nayaRes=img;
R=img(:,:,1);
G=img(:,:,2);
Error Masg:Index exceeds matrix dimensions.

Best Answer

After read the file type
>> size(img)
If the third dimension is not 3, it's not RGB image
Related Question