The code is self-explanatory.
Hi, I have a question.
Why is your output is different from matlab's imresize()? E.g. if I use factor 2 it gives 511x511 instead of 512x512. And why does the zoom version have a 'raster' pattern--shouldn't it use nearest neighbor interpolation?
Incidentally, what you call zoom is technically called enlarging. Zoom = cropping && enlarging.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.