If you're working with uint8, then all the pixel values are within [0 255]. The moment you try to do 0.9/im2(x,y), you end up with a small number less than 1, rounded to the nearest integer. Unless you're taking care with intermediate calculations and avoiding issues with mixed variable classes, it's probably simplest to just do the math in a floating point class.
You could simplify the arithmetic to fix the problem ...
inpict = im2uint8(linspace(0,1,100));
outpict = Equalization_0(inpict);
plot(inpict,outpict); grid on
xlim([0 255]); ylim([0 255]);
function image_out = Equalization_0(image_in)
im2 = im2uint8(image_in);
image_out = zeros(sy,sx,'uint8');
image_out(y,x) = slope*im2(y,x);
... but I doubt that's expected either. You probably intended something more like this.
image_out(y,x) = slope*(im2(y,x) - th);
Of course, this whole thing could be greatly simplified. None of the loops are necessary at all, and there are basic considerations that should be made as well.
inpict = im2uint8(linspace(0,1,100));
outpict = Equalization_1(inpict,th,slope);
plot(inpict,outpict); grid on
xlim([0 255]); ylim([0 255]);
function image_out = Equalization_1(image_in,th,slope)
image_out = slope*(im2double(image_in)-th);
image_out = max(min(image_out,1),0);
image_out = im2uint8(image_out);