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

22 Solutions

8 Solvers

Last Solution submitted on Sep 23, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers8

Suggested Problems

More from this Author44

Community Treasure Hunt

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

Start Hunting!