@RalfW,
I tested your code with an image saved in my MATLAB Drive and can confirm exactly what you're describing. The zoomed image stays confined to that narrow vertical strip with lots of unused space on both sides. This is actually a known limitation with MATLAB's imshow function and I found a few good solutions for you.
The simplest fix that worked well for me is to use image instead of imshow along with colormap and axis equal. Here's the modified code:
im = imread('yourimage.png');
imtall = repmat(im,11,1);
image(imtall)
colormap(gray)
axis equal
zoom(10)
The reason this works better is that imshow sets very strict DataAspectRatio constraints to maintain exact pixel aspect ratio. When you zoom in, these constraints force the image to stay in that narrow column regardless of how much window space is available. The image function with axis equal still maintains proper aspect ratio but allows MATLAB to use the screen space more flexibly during zoom operations. I tested this in MATLAB Mobile and it filled the window width significantly better than before while keeping everything in proportion. Please see attached.
If you have the Image Processing Toolbox, the Image Viewer app actually has much better zoom behavior for this exact situation. You can use it like this:
im = imread('cameraman.tif');
imtall = repmat(im,11,1);
imtool(imtall);
According to the MathWorks documentation at https://www.mathworks.com/matlabcentral/answers/325282 , when zooming in imtool, the width of the tall image will automatically expand to fill the figure, which is exactly what you're looking for. The Image Viewer was specifically designed to handle viewport management better than imshow for interactive viewing.
For even more control over zoom behavior, Steve Eddins created a File Exchange submission specifically to address this limitation. He's the former MathWorks developer who was actually involved in the evolution of imshow since 1993, and he wrote about this exact problem on his blog at https://steveeddins.com/image-zoom-pan/ . He created the Image Zoom Level and Pan Utilities which you can get from https://www.mathworks.com/matlabcentral/fileexchange/167316-image-zoom-level-and-pan-utilities or from GitHub at https://github.com/eddins/imzm . Once you install it, you can use it like this:
im = imread('cameraman.tif');
imtall = repmat(im,11,1);
imshow(imtall)
setImageZoomLevel(1000)
The setImageZoomLevel function was specifically written so that the available plot region is used when the zoom level is changed, instead of staying constrained to the initial narrow viewport. Steve actually mentioned in his blog that he submitted an enhancement request to MathWorks about this issue because it happens whenever DataAspectRatio is set to a fixed value, not just with images but even with regular plots.
For your linescan camera images, I'd recommend starting with the image and axis equal approach since it's the most straightforward and doesn't require additional toolboxes or downloads. It significantly improves the use of available window space for tall images.
If you need more interactive control or plan to do this regularly, imtool or Steve's utilities would be worth looking into.
