% which line has highest average value? clear clc I = imread('cameraman.bmp'); rowAVG = zeros(256,1); for i = 1 : 256 % i counts the rows rowAVG(i) = mean(I(i,:)); endfor x = 1 : 256; plot(x, rowAVG) grid on