Page 240 -
P. 240

gives

                                C =
                                     12345678

                             Or, we may want to expand A by stacking it on top of B (this is allowed only
                             if both matrices have the same number of columns). Enter:


                                D=[A;B]

                             produces

                                D =
                                     1234
                                     5678
                              We illustrate the appending operations for larger matrices: define E as the
                             (2 ⊗ 3) matrix with one for all its elements, and we desire to append it hori-
                             zontally to D. This is allowed because both have the same number of rows
                             (= 2). Enter:

                                E=ones(2,3)

                             produces

                                E =
                                     111
                                     111

                             Enter:

                                F=[D E]


                             produces

                                F =
                                     1234111
                                     5678111

                             Or, we may want to stack two matrices in a vertical configuration. This
                             requires that the two matrices have the same number of columns. Enter:

                                G=ones(2,4)


                             © 2001 by CRC Press LLC
   235   236   237   238   239   240   241   242   243   244   245