AMATH 352
Summer Quarter, 2008

Applied Linear Algebra and Numerical Analysis



Homework #6 Supplement Page


Here's code for back substitution: backsubstitute.m

Problem 1.

Compare the output of your program,
>> [Q,R] = myqr(A)
to the output you get from Matlab's built-in QR routine by entering
>> [Q,R] = qr(A,0)
There may be some differences in sign, owing to the fact that each column of Q represents a direction, and can have its sign flipped without changing anything. But other than that, the two should be the same.


Problem 4

Using parentheses to retrieve parts of a matrix does count against your limit.

If you end up needing extra parentheses, each extra pair (left and right) will cost you 2 points, out of 10 total for the problem.


Problem 5

You can use this program noisypower.m to make some data with which to check powerfit.m. Call it with
>> [x,y] = noisypower(numpoints);
where numpoints is the number of points to use.

Once you've found C and p, inspect your fit visually:

>> plot(x, y, '*')
>> hold on
>> plot(x, C*x.^p, 'r')
>> hold off


Problem 6

The program noisypoly.m will generate a noisy polynomial. Call it with
>> [x,y] = noisypoly(degree,numpoints);
Here degree is the degree of the polynomial, and numpoints is the number of points to generate.