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.84% Correct | 44.16% Incorrect
Last Solution submitted on Mar 24, 2025

Problem Comments

Solution Comments

Show comments
Registration Now Open for MathWorks AUTOMOTIVE CONFERENCE 2025
...
Hello Community, We're excited to announce that registration is now open for the...

Group

Project Euler I Image
Project Euler I
  • 10 Problems
  • 853 Finishers

Problem Recent Solvers528

Community Treasure Hunt

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

Start Hunting!
Go to top of page