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

    %% Resize Image Specifying Scale Factor and Interpolation Method
% 
%%
% Read image into the workspace.

% Copyright 2015 The MathWorks, Inc.

I = imread('rice.png');
%%
% Resize the image, specifying scale factor and the interpolation
% method.
J = imresize(I, 0.5, 'nearest');
%%
% Display the original and the resized image.
figure
imshow(I)
title('Original Image')
figure
imshow(J)
title('Resized Image Using Nearest-Neighbor')