% Test Script P3;
% Checks out WindowLS...
clc
randn('seed',0)
m = 50; n = 10; p = 30;
A = randn(m,n); b = randn(m,1);
rho0 = zeros(m-p+1,1);
for i=1:m-p+1
    Atilde = A(i:i+p-1,:);
    btilde = b(i:i+p-1,:);
    rho0(i) = norm(btilde - Atilde*(Atilde\btilde));
end
rho = WindowLS(A,b,p);
twoVectors = [rho0 rho]