Sequence Vectorization - II - MATLAB Cody - MATLAB Central

Problem 57939. Sequence Vectorization - II

Difficulty:Rate
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

38.89% Correct | 61.11% Incorrect
Last Solution submitted on Jul 31, 2024

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8

Problem Recent Solvers7

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!