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]

291 correct solutions
155 incorrect solutions

Last solution submitted on Jul 15, 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