Problem 1118. Colon operator of two vectors

You are given two vectors of equal length: VecStart, VecEnd

Each vector contain a set of integers, where VecEnd(j)>=VecStart(j)

You have to return a set (vector) of integers of the following form:

Output =... [ VecStart(1):VecEnd(1), VecStart(2):VecEnd(2),..,VecStart(end):VecEnd(end)]

For example:

VecStart = [1 10 4]

VecEnd = [3 10 7]

--> Output = [1 2 3 10 4 5 6 7]

Solution Stats

77.6% Correct | 22.4% Incorrect
Last solution submitted on Dec 04, 2016

Problem Comments


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!

Join the 15-year community celebration.

Play games and win prizes!

Learn more