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

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Generate a vector like 1,2,2,3,3,3,4,4,4,4

So if n = 3, then return

[1 2 2 3 3 3]

And if n = 5, then return

[1 2 2 3 3 3 4 4 4 4 5 5 5 5 5]

271 correct solutions
216 incorrect solutions

Last solution submitted on Mar 29, 2015

4 players like this problem

1 Comment

Jonathan
on 22 Nov 2013

Funny, I just tested you SO post too, and it has 2 nodes lest without the assignment to ans. I don't get this yet...

2 Comments