Problem 57939. Sequence Vectorization - II

This is the second part to the question - Sequence Vectorization - I
Given an array of Natural numbers, N, return the sequence - horizontal concatenation of (1:k) for k - N(1), N(2), ... N(end)
%Example 1
N=[2 5 3];
Out=[1 2, 1 2 3 4 5, 1 2 3];
%Example 2
N=[3 4];
Out=[1 2 3, 1 2 3 4];
%Example 2
N=[11 1 5];
Out=[1 2 3 4 5 6 7 8 9 10 11, 1, 1 2 3 4 5];
As the question deals with vectors, the solutions must be vectorized as well. Check the test suite for banned functions.

Solution Stats

31.25% Correct | 68.75% Incorrect
Last Solution submitted on Nov 25, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers5

Suggested Problems

More from this Author31

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!