IMRESIZEN: resize an N-dimensional array

version (1.44 KB) by Matt J
An N-dimensional analog of the imresize() function


Updated 24 Sep 2017

View License

This file is an N-dimensional analog of the imresize() function from the Image Processing Toolbox. Namely, it allows one to perform a stretch or contraction of an N-dimensional image by some factor, or a different factor along each dimension. No toolboxes are required to use it, but it doesn't handle color images.




X: n-dimensional input array (single or double)
scaling: scaling factor(s) as scalar or n-vector. Scalings along singleton dimensions of X are always ignored.
extrapMethod: extrapolation method (same options as for griddedInterpolant). Default is linear interpolation.


Y: resized array



(1) imresizen(img4D,2);
(2) imresizen(img4D,1./[3,2,1,4]);
(3) imresizen(___, 'cubic')

Cite As

Matt J (2022). IMRESIZEN: resize an N-dimensional array (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!