Page 107 - A Guide to MATLAB for Beginners and Experienced Users
P. 107

88        Practice Set B: Calculus, Graphics, and Linear Algebra


                        (b) Now try the same method on Problem 4 of Practice Set A. MATLAB
                            finds one, but not all, answer(s). Can you explain why? If not, see
                            Problem 11 below, as well as part (d) of this problem.
                         (c) Next try the method on this problem:

                                     w + 3x − 2y + 4z = 1
                                   −2w + 3x + 4y − z = 1
                                   −4w − 3x + y + 2z = 1
                                     2w + 3x − 4y + z = 1.

                            Check your answer by matrix multiplication.
                        (d) Finally, try the matrix division method on:
                                   ax + by = u
                                   cx + dy = v.

                            Don’t forget to declare the variables to be symbolic. Your answer
                            should involve a fraction, and so will be valid only when its de-
                            nominator is nonzero. Evaluate det on the coefficient matrix of the
                            system. Compare withthe denominator.
                     11. We deal in this problem with 3 × 3 matrices, although the concepts are
                        valid in any dimension.
                        (a) Consider the rows of a square matrix A. They are vectors in 3-space
                            and so span a subspace of dimension 3, 2, 1, or possibly 0 (if all
                            the entries of A are zero). That number is called the rank of A.The
                            MATLAB command rank computes the rank of a matrix. Try it
                            on the four coefficient matrices in each of the parts of Problem 10.
                            Comment on MATLAB’s answer for the fourth one.
                        (b) An n × n matrix is nonsingular if its rank is n. Which of the four
                            matrices you computed in part (a) are nonsingular?
                         (c) Another measure of nonsingularity is given by the determinant —a
                            fundamental result in linear algebra is that a matrix is nonsingular
                            precisely when its determinant is nonzero. In that case a unique
                            matrix B exists that satisfies AB = BA = the identity matrix. We
                                                           −1
                            denote this inverse matrix by A . MATLAB can compute inverses
                            with inv. Compute det(A) for the four coefficient matrices, and for
                            the nonsingular ones, find their inverses. Note: The matrix equation
                                                                       −1
                            Ax = b has a unique solution, namely x = A b = A\b, when A is
                            nonsingular.
                     12. As explained in Chapter 4, when you compute [U, R] = eig(A), each
                        column of U is an eigenvector of A associated to the eigenvalue that
   102   103   104   105   106   107   108   109   110   111   112