% Igor Yanovsky
% Teaching Assistant
% Math 151B
% 05/29/07
% This program solves normal equations given matrix A and vector b

clear all

A = [1 1 1; 1 2 4; 1 4 16; 1 5 25]

b = [2 3 5 6]'

A'*A
A'*b

u = inv(A'*A)*(A'*b)

norm( A*u - b, 2 )



clear all