Matrix with different incremental runs - MATLAB Cody - MATLAB Central

Problem 794. Matrix with different incremental runs

Difficulty:Rate

Given a vector of positive integers

a = [ 3 2 4 ];

create the matrix where the i th column contains the vector 1:a(i) possibly padded with zeros:

b = [ 1 1 1
      2 2 2
      3 0 3
      0 0 4 ];

Solution Stats

55.6% Correct | 44.4% Incorrect
Last Solution submitted on Mar 07, 2025

Problem Comments

Solution Comments

Show comments

Group

Strings II Image
Strings II
  • 21 Problems
  • 41 Finishers

Problem Recent Solvers522

Community Treasure Hunt

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

Start Hunting!
Go to top of page