I am trying to use this function little luck.

======== manual definition ========
circshift(A, shifts)
Circularly shift the data in an array. The second argument is a vector 
giving the amount to shift in each dimension
==============================

Sample script with test data
======================
module MyModule
#-- attempting to use circshift to rearrange columns
numrows = 5
a1 = fill(1,numrows,1)
a2 = fill(2,numrows,1)
a3 = fill(3,numrows,1)
a4 = fill(4,numrows,1)
a5 = fill(5,numrows,1)
c = hcat(a1,a2,a3,a4,a5)
println(c)
d = circshift(c,[2,1,1,1,1])
println(d)
end

I just cannot get my head around on how the shifts work for each dimension.

Can anyone elaborate?...Thanks Archie

Sample output
============

5 1 2 3 4
 5 1 2 3 4
 5 1 2 3 4
 5 1 2 3 4
 5 1 2 3 4


Reply via email to