The variable visionk ends up holding the average of a measure of the distance (max-min) scaled by the max of the subsections of the image in 96x128 rectangular areas. These areas overlap since the loops are stepping by 10 instead of by 96/128. The max(max(...)) is a common Matlab idiom to get the overall maximum of a rectangular array as max() returns the maxima by column first, then the second call finds the maximum of that vector. This lets one get the overall max/min without either a temporary or using reshape() to transform to a vector.
There's quite a lot of suprerfluous "stuff" in the loop starting with the casting to double and then assigning I2 to A; might as well have just used I1 throughout.
The one real lack that hurts performance is that vision is not preallocated so it is reallocated on every pass through the loop.
vision=zeros(ceil((960-96)/10)*ceil((1280-128)/10),1);
before the loop would be beneficial.
Minor rewrite--it would probably be better to use size() to compute the limits, but don't know that there isn't a reason for the specific magic numbers here so will leave as "exercise for the student".
I=imread('image11.jpg');
vision=zeros(ceil((960-96)/10)*ceil((1280-128)/10),1);
k=0;
for i=1:10:(960-96)
for j=1:10:(1280-128)
k=k+1;
A=I(i:i+95,j:j+127);
m1=max(A(:));
m2=min(A(:));
vision(k)=(m1-m2)/(m1);
end
end
visionk=mean(vision);