Homwork 4 16

Homwork 4 16 - 16.1)

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
16.1) The function, powermethod, performs the Power Method on a given symmetric matrix A nxn until the change between vectors obtained is less than a given tolerance. After the tolerance has been met, the program outputs the number of iterations to achieve the tolerance, the largest eigenvalue of A, and a vector which is equal to one of the eigenvectors of A divided by the norm of that eigenvector. As A increased in size, never did the number of iterations reach beyond 6 times the dimension of A. Otherwise, the number of iterations needed varied greatly inside of that bound. The following is the code for powermethod: function [i ev ew] = powermethod(A,tol) % PowerMethod performs the Power Method on % a given symmetric matrix A. % A -- square matrix % tol -- tolerance to determine when x has stopped changing % Obtain the column dimension of A n = size(A,1); x = ones(n,1); % Set the two vectors--which will be compared to see if % the Power Method is producing a new ev or not--to % two dummy vectors whose difference is outside of the tolerance
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Homwork 4 16 - 16.1)

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online