Question

An eigenvalue of the matrix A is a number å such that, for some vector x, Ax = ix. The particular vector x for which this equality holds is called

the eigenvector of A. Note that i does not need to be a real number, and is often a complex number Using a computer to find the eigenvalues of a matrix is not an easy problem. However, MATLAB© has a built-in command eig which accepts a matrix as input and returns the eigenvalues of A. Play around with eig using a couple of simple examples. Write a script called RandEig that generates 500 random matrices using randn(100) and plots all of the eigenvalues as dots on the same graph. Note that if xis a vector of complex number plot (x) will plot the real parts versus the complex parts, which is what we want here. Type axis equal at the end of yourscript. Write a function Output A that accepts as input a 3 x 3 matrix A and, using f print f, outputs the matrix on the screen using \t to seperate the columns.Hint: You will probably need to write an inner loop for columns and an outer loop for rows. Recall that one defination of the number e is given by e = lim r, where r, is given by r_{n}=\left(1+\frac{1}{n}\right)^{n} Using this definition, write a script LimE that creates a vector rn that calculates r, for n from 1 to 500. Then create a vector error =vector represents the difference between e and rn for each n. Using semilog , plot your error vector. Note: if you supply semilogy with a single vector, it will automatically create an appropriate vector of x-values. Use fprint f at the end of your file to write a small message which displays the last element of exp(1) – rn. This the error vector.

Fig: 1

Fig: 2

Fig: 3

Fig: 4

Fig: 5

Fig: 6

Fig: 7

Fig: 8

Fig: 9

Fig: 10

Fig: 11