Entering Tables and Matrices

The Wolfram System front end provides an (MenuGrayLink[Insert, paclet:guide/InsertMenu]) ▶ (MenuGrayLink[Table/Matrix, paclet:ref/menuitem/TableMatrix]) submenu for creating and editing arrays with any specified number of rows and columns. Once you have such an array, you can edit it to fill in whatever elements you want.

The Wolfram Language treats an array like this as a matrix represented by a list of lists:

({{a, b, c}, {1, 2, 3}})

Putting parentheses around the array makes it look more like a matrix, but does not affect its interpretation:

(({{a, b, c}, {1, 2, 3}}))

Using (RefLink[MatrixForm, paclet:ref/MatrixForm]) tells the Wolfram Language to display the result of the (RefLink[Transpose, paclet:ref/Transpose]) as a matrix:

MatrixForm[Transpose[(({{a, b, c}, {1, 2, 3}}))]]

Entering tables and matrices.

Note that you can use Ctrl+, and Ctrl+Enter to start building up an array, and particularly for small arrays this is often more convenient than using the (MenuGrayLink[New, paclet:ref/menuitem/New-TableMatrix]) menu item in the (MenuGrayLink[Table/Matrix, paclet:ref/menuitem/TableMatrix]) submenu. The (MenuGrayLink[Table/Matrix, paclet:ref/menuitem/TableMatrix]) menu items typically allow you to make basic adjustments, such as drawing lines between rows or columns.

Entering a (RefLink[Piecewise, paclet:ref/Piecewise]) expression is a special case of entering a table.

Enter the (RefLink[\[Piecewise], paclet:ref/character/Piecewise]) character and press Ctrl+, to get a template of placeholders for two cases:

f[x_]:=(Piecewise[{{\[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder]}}])

Fill in the placeholders to complete the piecewise expression:

f[x_]:=(Piecewise[{{0, x<0}, {1, x==0}}])

To add additional cases, use Ctrl+Enter:

f[x_]:=(Piecewise[{{0, x<0}, {1, x==0}, {\[Placeholder], \[Placeholder]}}])

You can make an element in a table span over multiple rows or columns by selecting the entire block that you want the element to span and using the (MenuGrayLink[Insert, paclet:guide/InsertMenu]) ▶ (MenuGrayLink[Table/Matrix, paclet:ref/menuitem/TableMatrix]) ▶ (MenuGrayLink[Make Spanning, paclet:ref/menuitem/MakeSpanning]) menu command. To split a spanning element into individual components, use (MenuGrayLink[Insert, paclet:guide/InsertMenu]) ▶ (MenuGrayLink[Table/Matrix, paclet:ref/menuitem/TableMatrix]) ▶ (MenuGrayLink[Split Spanning, paclet:ref/menuitem/SplitSpanning]).

To make the top element span across both columns, first select the row:

({{x, \[Placeholder]}, {y, z}})

Now use the (MenuGrayLink[Make Spanning, paclet:ref/menuitem/MakeSpanning]) menu command.

({{x, }, {y, z}})