Getting Started Previous page   Next Page

Concatenation

Concatenation is the process of joining small matrices to make bigger ones. In fact, you made your first matrix by concatenating its individual elements. The pair of square brackets, [], is the concatenation operator. For an example, start with the 4-by-4 magic square, A, and form

The result is an 8-by-8 matrix, obtained by joining the four submatrices:

This matrix is halfway to being another magic square. Its elements are a rearrangement of the integers 1:64. Its column sums are the correct value for an 8-by-8 magic square:

But its row sums, sum(B')', are not all the same. Further manipulation is necessary to make this a valid 8-by-8 magic square.


Previous page  M-Files Deleting Rows and Columns Next page

© 1994-2005 The MathWorks, Inc.