This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 3. Write a MATLAB function P=eigbasis(A) which accepts as input an n × n ma-trix A and gives as output an n × n invertible matrix P whose columns are eigen-vectors for A . The matrix P may have complex entries. If A is not diagonaliz-able then your function should give an appropriate error message. Your function should not rely on any built-in MATLAB functions for ±nding eigenvectors, such as [V,D] = eig(X) . Once again we must beware of problems with roundoF er-rors. Therefore you should use the program newnullbase (given on the back of the page) instead of nullbase (or rref ). Apply the function eigbasis to each of the matrices in problem 1. function B=newnullbase(A) [m,n]=size(A); [R,jb]=rref(A,10^(-7)); r=length(jb); d=n-r; l=zeros(1,n); l(1,jb)=ones(1,r); l=logical(l); k=~l; B=zeros(n,d); if d>0, B(l,:)=-1*R(1:r,k); B(k,:)=eye(d); end...
View Full Document
This note was uploaded on 12/27/2011 for the course MAS 3114 taught by Professor Olson during the Fall '08 term at University of Florida.
- Fall '08