Nxn matrix with elements between 1...n^2
Show older comments
Hi everyone. I have to do a nxn matrix, whose elements are natural numbers between 1...n^2. For example, if n=3 the matrix will be:
[1 2 3; 4 5 6; 7 8 9]
Also, I have to be able to order the matrix by rows or columns.
Of course, thanks. I'm just starting with the Matlab world and it's not easy lol.
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!