Is it possible to colour the rows or columns of a matrix?

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
1 reply · 2K views
piJohn1411
Messages
1
Reaction score
0
Hi,

I was wondering if it's possible to colour the rows and columns of a matrix in mathematica.

I have received help from another forum and the code of my matrix is the following:

Rasterize@
Style[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 -> {Center, Center}] // TraditionalForm, 30]

Thank you for your help.
 
Physics news on Phys.org