I want to write a code in Matlab. There is a picture of size (258, 320). It is a color picture. I want to show the image using one color channel. Try to plotting the values from a row of the image.
% Color planes
img = imread('fruit.png');
imshow(img);
disp(size(img));
% TODO: Select a color plane, display it, inspect values from a row
img_blue = img(:,:,2);
imshow(img_blue);
plot(img_blue(150,0));
I got this error error: img_blue(_,0): subscripts must be either integers 1 to (2^31)-1 or logicals error: execution exception in main.m
Can anyone please help m to overcome the problem.

