Shifts data by rearranging dimensions
[y,perm,nshifts]=shiftdata(x,dim) Shifts the entries along dimension dim in x to the first column and returns the permutation vector in perm [y,perm,nshifts]=shiftdata(x) Shifts the entries along dimension dim in x to the first column and returns the number of shifts in nshifts
//When dim is specified: x=testmatrix('magi',3) x = 8. 1. 6. 3. 5. 7. 4. 9. 2. [y,perm,nshifts] = shiftdata(x,2) nshifts = [] perm = 2. 1. y = 8. 3. 4. 1. 5. 9. 6. 7. 2. //When dim is not specified: x=1:5 x = 1. 2. 3. 4. 5. [y,perm,nshifts] = shiftdata(x) nshifts = 1. perm = [] y = 1. 2. 3. 4. 5. |