Cody

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

Created by Binbin Qi in Community

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]

Solution Stats

45.02% Correct | 54.98% Incorrect
Last solution submitted on Mar 24, 2019

Problem Comments

Solution Comments

Recent Solvers664

Suggested Problems

More from this Author17

Tags

Discover MakerZone

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

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!