www.gusucode.com > images 案例代码 matlab源码程序 > images/ResizeRGBImageSpecifyingSizeOfOutputImageExample.m

    %% Resize RGB Image Specifying Size of Output Image
% 
%%
% Read image into the workspace.

% Copyright 2015 The MathWorks, Inc.

RGB = imread('peppers.png');
%%
% Resize the image, specifying that the output image have 64 rows. Let
% |imresize| calculate the number of columns necessary to preserve the
% aspect ratio.
RGB2 = imresize(RGB, [64 NaN]);
%%
% Display the original image and the resized image.
figure
imshow(RGB)
title('Original Image')
figure
imshow(RGB2)
title('Resized Image')