Code covered by the BSD License  

Highlights from
Shift matrix

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

Shift matrix

by

 

17 Jun 2011 (Updated )

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

| Watch this File

File Information
Description

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 (http://home.online.no/~pjacklam).

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

Updated help.

Contact us