for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice. Example : in->[2 3 NaN 5] and out->[2 2 3 3 NaN NaN 5 5]
This solution only works for vectors that are already sorted from low to high :) but it passed the test suite
This works in R2012b, but not on cody
function ans = duplicate(x)
[x;x];
x(:)';
end
550 Solvers
It dseon't mettar waht oedrr the lrettes in a wrod are.
493 Solvers
435 Solvers
247 Solvers
724 Solvers
Solution 489792
improve test suit