Code covered by the BSD License  

Highlights from
Circular Shift Columns

Be the first to rate this file! 11 Downloads (last 30 days) File Size: 1.92 KB File ID: #37687
image thumbnail

Circular Shift Columns

by

 

01 Aug 2012 (Updated )

This function quickly and independently circularly shift each column of an input matrix

| Watch this File

File Information
Description

CIRCSHIFT_COLUMNS Circularly shift each column by a different amount

   B = CIRCSHIFT_COLUMNS(A, SHIFT_VECTOR) circularly shifts the columns in A
   by the values specified in the vector D. Negative elements of D shift columns up
   and positive values shift columns down.

   B = CIRCSHIFT_COLUMNS(A) generates random shift values bound
   between 0 and the number of rows in A.

   [B D] = CIRCSHIFT_COLUMNS(...) returns the vector of shift values

   Example:
       A = [ 1 1 1; 2 2 2; 3 3 3; 4 4 4];
       B = circshift_columns(A, [0 1 -2]);
       B = 1 4 3
            2 1 4
            3 2 1
            4 3 2

MATLAB release MATLAB 7.14 (R2012a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
02 Aug 2012

fixed typo in summary

20 Aug 2012

Fixed spelling errors in the help documentation

Contact us