A4 Scripts

 

P1

% P1 Checks pTLS

clc
randn('seed',0)
format short
m = 10;
n = 5;
A = randn(m,n);
b = randn(m,1);
for p=0:n
    disp(sprintf('p = %2d',p))
    [x,E,r] = pTLS(A,b,p)
    disp('::::::::::::::::::::::::::::::::::::::::::::::::')
end

P2

% Script P2: Tests pTLS

clc
randn('seed',0)
m = 50; n = 10; p = 30;
A = randn(m,n); b = randn(m,1);
rho = WindowLS(A,b,p)