Richard, I think your test suite has an error in it. Both pd and pad will result in the same matrix, as they're both circshifted by [1 1-i] Will pad=fliplr(pad); after the for loop correct this problem?
Test Suite fixed. Who new that 1-i is the same as -i+1.
The circular shift should be made from first row, not the 2nd, and the "knight" always moves down from the first column of the row to the last column in an L-movement.
I had not recognized the symmetry of row and column processing. A very succinct method to create a Knight pattern.
3241 Solvers
Implement simple rotation cypher
943 Solvers
Without the French accent please!
109 Solvers
MatCAT - Reconstruct X from Its X-rays
49 Solvers
Decimation - Optimized for speed
89 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!