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

116 Solutions

31 Solvers

Last Solution submitted on Sep 29, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...