Shift matrix
by Shalin Mehta
17 Jun 2011
(Updated 30 Nov 2011)
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 (2010b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 30 Nov 2011 |
Updated help. |
|
Contact us at files@mathworks.com