This solution is outdated. To rescore this solution, sign in.
-
1 Comment
Shizun Li
on 31 Oct 2018
Check this out.
function b = back_and_forth(n)
b=1:n^2;
b=reshape(b,n,n)';
for i=2:2:n
b(i,:)=fliplr(b(i,:));
end
end
Suggested Problems
-
2306 Solvers
-
743 Solvers
-
MATCH THE STRINGS (2 CHAR) very easy
293 Solvers
-
463 Solvers
-
600 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!