Numerical Linear Algebra
Math 706 -- Spring 2006

Professor Doug Meade
meade@math.sc.edu
Department of Mathematics
University of South Carolina


MATLAB Demonstrations and Scripts

Filename
Comments
HarmonicSum.m MATLAB m-file that illustrates the non-associativity of floating-point arithmetic by computing partial sums of the harmonic series by adding the terms in decreasing and increasing order
forward.m MATLAB m-file for forward substitution with a row-oriented implementation
backward.m MATLAB m-file for backward substitution with a row-oriented implementation
forwardC.m MATLAB m-file for forward substitution with a column-oriented implementation
Fscript.m MATLAB script to compare forward and forwardC
qrstep.m MATLAB m-file for one step of the QR algorithm with shifting by A(n,n)
qrstep0.m MATLAB m-file for one step of the QR algorithm with NO shifting
qrstepR.m MATLAB m-file for one step of the QR algorithm with user-specified shift
qrstepW.m MATLAB m-file for one step of the QR algorithm with Wilkinson shifting
GS.m MATLAB m-file for Gauss-Seidel method for iterative solution of Ax=b (with convergence test based on difference between successive iterates)
GSR.m MATLAB m-file for Gauss-Seidel method for iterative solution of Ax=b (with convergence test based on the residual)
Jacobi.m MATLAB m-file for Jacobi method for iterative solution of Ax=b (with convergence test based on difference between successive iterates)
JacobiR.m MATLAB m-file for Jacobi method for iterative solution of Ax=b (with convergence test based on the residual)
iterate.m MATLAB script for testing of iterative solvers for Ax=b
iterate-conv.m MATLAB script for testing of iterative solvers for Ax=b
iterate-test.m MATLAB script for testing of iterative solvers for Ax=b
PowerMethod.m MATLAB m-file for Power Method for iterative approximation of dominant eigenvalues
InvPowerMethod.m MATLAB m-file for Inverse Power Method for iterative approximation of eigenvalue closest to 0 (in modulus)
ShiftInvPowerMethod.m MATLAB m-file for Shifted Inverse Power Method for iterative approximation of eigenvalues
descent.m MATLAB script to experiment with descent methods for solving Ax=b
descent1.m MATLAB m-file for generic descent algorithm (with exact line search)
ConjGrad.m MATLAB m-file for the Conjugate Gradient method

Notes:

  • MATLAB scripts (.m files) should be downloaded to your local computer (I recommend creating a folder called, say, MATLAB-files.) Then, from within MATLAB, under the File menu, select Run Script ... and Browse to the location where you save the .m file; select the script and click OK. All output will appear in your MATLAB window.
  • Portable Document Format (PDF) files are viewable with acroread, a publicly available PDF viewer by Adobe.
  • PostScript (PS) files are viewable with ghostview, the public domain PS viewer.

  • If you have any questions, please send e-mail to meade@math.sc.edu
    Last modified: 24 April 2006