324 CHAPTER 13. MATRICES AND THE INNER PRODUCT

13.8 MATLAB And Singular Value DecompositionMATLAB can find this very well. The syntax is [U,S,V]=svd(A) and it will give you theunitary matrices U,V such that U∗AV = S where S is the singular value matrix. Here is anexample.

A=[1,2,5;3,-2,-1];[U,S,V]=svd(A)Then press return to get the desired matrices. Check your work by typing at >>

U’*A*V and press enter to see S.MATLAB can also find the Moore Penrose inverse or pseudoinverse as follows. First

enter A followed by ; and then type B=pinv(A) and press return. It will give the pseudoin-verse. Here is an example where A does not have an inverse.

A=[1,2,3;2,4,6;-3,-2,1];B=pinv(A)

13.9 Exercises1. Here are some matrices. Label according to whether they are symmetric, skew sym-

metric, or orthogonal. If the matrix is orthogonal, determine whether it is proper orimproper.

(a)

 1 0 00 1/

√2 −1/

√2

0 1/√

2 1/√

2

(b)

 1 2 −32 1 4−3 4 7



(c)

 0 −2 −32 0 −43 4 0



2. Show that every real matrix may be written as the sum of a skew symmetric and asymmetric matrix. Hint: If A is an n× n matrix, show that B ≡ 1

2

(A−AT

)is skew

symmetric.

3. Let x be a vector in Rn and consider the matrix I− 2xxT

||x||2. Show this matrix is both

symmetric and orthogonal.

4. For U an orthogonal matrix, explain why ||Ux||= ||x|| for any vector x. Next explainwhy if U is an n×n matrix with the property that ||Ux||= ||x|| for all vectors, x, thenU must be orthogonal. Thus the orthogonal matrices are exactly those which preservedistance.

5. A quadratic form in three variables is an expression of the form a1x2 +a2y2 +a3z2 +a4xy+a5xz+a6yz. Show that every such quadratic form may be written as

(x y z

)A

 xyz

where A is a symmetric matrix.