MATLAB: Circshift() one number ,in each iteration

circshiftmatrix

can I am do shifting the number A(2,1) of matrix (A) ,one times in each iteration,('iter=0' ,iter=iter+1)? how can do that?
A=[1 2 3;4 5 6;7 8 9]
% Shift A(2,1)
for k=1:size(A,2)-1
A(2,:)=circshift(A(2,:),[0 1])
end

Best Answer

Maybe you want to save all the results
clear
A=[1 2 3;4 5 6;7 8 9]
% Shift A(2,1)
for k=1:size(A,2)-1
A(2,:)=circshift(A(2,:),[0 1])
out{k}=A
end
celldisp(out)
Related Question