Perform Operation Only on Specified Rows.
2 views (last 30 days)
Show older comments
I have attempted to modify this code that circshifts the even rows a specified number of times, however I would like to make it more general, specifically to shift the first row by 0, the second row by N, the third row by N^2 the, then repeat after N times. Any help would be appreciated. Thanks.
A=randi(9,10,4)
N = 3;
for i = 1:N
idx=i:N:size(A,1)
Ae=A(idx,:);
for jj = i:N^2
Ae1=circshift(Ae,[0 -jj]);
A(i,:)=Ae1;
end
end
0 Comments
Answers (1)
See Also
Categories
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!