Problem 45578. Create a matrix that counts up diagonally
Given a single input N, create a N x N matrix that counts from 1 : N ², (along up-right diagonals, starting with 1 in the top left corner. For example, given N=4...
1 3 6 10 2 5 9 13 4 8 12 15 7 11 14 16
Notice as you move up a row and right a column (↗) the values always increase by one. The value '1' should always go in the top left corner, with '2' directly below it. From there fill in the upward-rightward diagonals with the next higher integer until the matrix is complete. Assume N will always be a positive integer greater than 1 (N >= 2).
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers20
Suggested Problems
-
Reverse the Words (not letters) of a String
448 Solvers
-
84 Solvers
-
Simple equation: Annual salary
4201 Solvers
-
Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
942 Solvers
-
905 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!