MATLAB: Circshift the columns of an array with different shiftsize withou using for loop

circshiftmatrixmatrix manipulation

As the tittle suggests I am wondering if it is possible to circshift the columns of an array with a different shiftsize in each column without using a for loop.
Example:
a=randi(10,5,4);
I want to do this
a(:,4)=circshift(a(:,4),[-1 0]);
a(:,3)=circshift(a(:,3),[-2 0]);
without a loop. Is it possible?

Best Answer

[m,n]=size(a);
S=full(sparse(mod(shiftindex,m)+1,1:n,1,m,n));
a_new=ifft(fft(a).*fft(S),'symmetric')