Problem 867. Replicate elements in vectors

Replicate each element of a row vector (with NaN) a constant number of times. Examples

 n=2, A=[1 2 3] -> [1 1 2 2 3 3]
 n=0, A=[2 1]   -> []

Solution Stats

50.15% Correct | 49.85% Incorrect
Last solution submitted on Dec 09, 2018

Problem Comments

Recent Solvers571

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!