Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Problem 1035. Generate a vector like 1,2,2,3,3,3,4,4,4,4

Created by Binbin Qi

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]

Tags

Problem Group

Solution Statistics

298 correct solutions 239 incorrect solutions
Last solution submitted on Feb 01, 2016

Problem Comments

Solution Comments