Problem 46716. Matrix with increasing numbers (★★★★)

Create a matrix Z with m rows and n columns that contain the numbers 1 to m*n in ascending order in the following manner. The first row will contain numbers 1 to n. The second row will contain n+1 to 2n and so on. Thus, if m = 3, n = 4, the output matrix Z will have 3 rows and 4 columns and will be the following:
[1 2 3 4;
5 6 7 8;
9 10 11 12]
This become trivial if you use loops, but do this without using loops, i.e. for/while not permitted. Additionally, the reshape command makes this very easy, so avoid that as well.

Solution Stats

26.85% Correct | 73.15% Incorrect
Last Solution submitted on Aug 04, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers28

Suggested Problems

More from this Author52

Problem Tags

Community Treasure Hunt

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

Start Hunting!