What is the fastest method to shift matrix?

Thank you very much for your tips.

I have tried the permute! with dropzeros! but it is slower. Yes, I think I should not apply the dropzeros! at each time, but this is a bit annoying.:slight_smile: