clear all; close all; clc img=imread('lena.bmp'); figure; imshow(uint8(img)); [m n]=size(img); img_max=0; img_min=256; img_avg=0; for i=1:1:m for j=1:1:n if img(i, j)<img_min img_min=img(i,j); end if img(i, j)>img_max img_max=img(i,j); end img_avg=i…