Problem 760. Duplicate each element of a vector.
Solution Stats
Problem Comments
Solution Comments
-
1 Comment
improve test suit
-
1 Comment
This solution only works for vectors that are already sorted from low to high :) but it passed the test suite
-
1 Comment
This works in R2012b, but not on cody
function ans = duplicate(x)
[x;x];
x(:)';
end
Problem Recent Solvers545
Suggested Problems
-
210 Solvers
-
Back to basics 23 - Triangular matrix
736 Solvers
-
427 Solvers
-
How many trades represent all the profit?
557 Solvers
-
277 Solvers
More from this Author10
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!