File Exchange

image thumbnail

Shift matrix

version 1.1 (13.2 KB) by

Fast and convenient function for shifting a matrix in 2D.

1 Download


View License

The code uses array indexing to implement shifting of the matrix. It is about 2.5 times faster than using interp2 with 'nearest neighbor' option for shifting of the matrices. Inspiration for optimized array indexing comes from a snippet on circular shift in: "MATLAB array manipulations tips and tricks" guide by Peter J. Acklam (

Comments and Ratings (0)



Updated help.

MATLAB Release
MATLAB 7.11 (R2010b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video