To scale the image in the same way as imagesc do the following
Amin = min(A(:));
Amax = max(A(:));
A_scaled = (A - Amin)/(Amax - Amin);
To prove that the scaled image is what imagesc does internally then try this
imagesc(A,[Amin Amax]);
pause
imagesc(A_scaled);