hw3 - CME302 Homework 3 October 6, 2009 T&B 10.1, 10.2,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CME302 Homework 3 October 6, 2009 T&B 10.1, 10.2, 11.1, 11.3 For 11.3(b), you will need mgs.m. You can use your own if you chose to implement it last week, or you can download it from the Materials section of Coursework. For reference, this is the implementation: function [Q R] = mgs(A) % Modified Gram-Schmidt orthogonalization. [m n] = size(A); V = zeros(m,n); Q = zeros(m,n); R = zeros(n); for(j = 1:n) V(:,j) = A(:,j); for(i = 1:j-1) % In CGS, V in the next line is A. R(i,j) = Q(:,i)'*V(:,j); V(:,j) = V(:,j) - R(i,j)*Q(:,i); end R(j,j) = sqrt(V(:,j)'*V(:,j)); Q(:,j) = V(:,j) / R(j,j); end 1 ...
View Full Document

This document was uploaded on 06/17/2010.

Ask a homework question - tutors are online