scale_x (m, factor): produces a matrix with the same number of rows
as m, but number of columns scaled by factor factor == 1.0, then
we get the same image; factor < 1.0: squeeze; factor > 1.0: stretch.
notes:
functions round(x), floor(x) and ceil(x) might be handy.
example: a "pixel" in the scaled image you are building
might not map to exactly one pixel from your source
matrix (might map to column 200.33 for example -- then
you are between column 200 and 201 in the source matrix).
Since matlab is so loose with types, division doesn't
"truncate" like in C.
Similarly, cast(x, "uint8") will round float x and produce
an unsigned 8-bit integer (which is what you want to populate
an image matrix with).