View License

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

» Watch video

Highlights from
Shift matrix

Be the first to rate this file! 3 Downloads (last 30 days) File Size: 13.2 KB File ID: #31840 Version: 1.1
image thumbnail

Shift matrix



17 Jun 2011 (Updated )

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

| Watch this File

File Information

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 (

MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
30 Nov 2011 1.1

Updated help.

Contact us