I am getting the value 255 all the time in the below loop. P is an lena image of size m*n*3 (m=256,n=256). Actually i need the sum of all pixel values in the entire image. sum=0;
for i=1:3 for j=1:256 for k=1:256 sum = sum+P(j,k,i) end end end
Please help me to solve the problem.
Best Answer