This solution is outdated. To rescore this solution, sign in.
-
3 Comments
Farhad
on 27 Jan 2012
Incorrect solution. If the array has only one column, this solution generates two columns.
Ned Gulley
on 30 Jan 2012
Actually this solution works just fine. Try it in MATLAB. It doesn't create two columns.
yile
on 22 Feb 2012
You can't just do B = A(:,[end,1])...this would end up two columns if A has only one column. You should do A(:,[1,end]) = A(:,[end,1])) and then B = A
Suggested Problems
-
Longest run of consecutive numbers
5836 Solvers
-
718 Solvers
-
474 Solvers
-
1018 Solvers
-
2015 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!