MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Todayfor 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]

275 correct solutions
148 incorrect solutions

Last solution submitted on Apr 16, 2014

1 Comment

Duane Hanselman
on 31 Dec 2012

This works in R2012b, but not on cody
function ans = duplicate(x)
[x;x];
x(:)';
end

1 Comment