Skip to main content

How to create a general format of a matrix with specified entries?


I want to create a PNG picture of a matrix where its entries are the following:



n,   n-1,   ..., 1,
2n, 2n-1, ..., n+1,
3n, 3n-1, ..., 2n+1,
...
n^2, n^2-1, ..., (n-1)n+1

For example, I was thinking something like the picture below (including the dots)


enter image description here


I have tried to use the command mat = {{1, 2}, {3, 4}} but it does not accept {...} as the three dots.


I would really appreciate any suggestions/hints on how to do this.



UPDATE: I have created using the following code


MatrixForm[{{n, -1 + n, -2 + n, \[CenterEllipsis], 1}, {2 n, 2 n - 1, 
2 n - 2, \[CenterEllipsis], n + 1}, {3 n, 3 n - 1,
3 n - 2, \[CenterEllipsis],
2 n + 1}, {\[VerticalEllipsis], \[VerticalEllipsis], \\[VerticalEllipsis], \[DescendingEllipsis], \[VerticalEllipsis]}, \{n^2, -1 + n^2, -2 + n^2, \[CenterEllipsis], HoldForm[(n - 1) n + 1]}}, TableAlignments -> Right] // TraditionalForm

this matrix


enter image description here


Thank you very much for your help.



Answer




You can just type it in. Like so


example


The various forms of ellipses are found on the Special Characters palette under the § tab of the Symbols tab. This palette is available from the Palettes menu.


You can get a PNG by selecting the output cell and choosing Save Selection As... from the File Menu (as I did for this post).


Comments