MATLAB: Imshow – Stretching image to fill axis

guiguideImage Processing Toolboximshow

I'm trying to display an image on an axis within a GUI. I'm using the imshow function, but it keeps the dimension ratio of the image. I would like to stretch the image, ignoring the dimension ratio, to fill the axis. Any suggestions?
Thanks, Matt

Best Answer

You can display with imshow() and use the 'XData' and 'YData' property. For example:
imshow(grayImage, [], 'XData', [0 .5], 'YData', [0 .1]);