format compact


A = hilbert(12);
{Undefined function 'hilbert' for input arguments of type 'double'.} 
A = hilb(12);


n = 12;
x0 = ones(n,1);
b = A*x0;


b = b + 1.e-12*randn(n,1);


A\b
ans =
   1.0e+03 *
    0.0010
    0.0010
    0.0020
   -0.0129
    0.1012
   -0.4317
    1.1880
   -2.1171
    2.4518
   -1.7723
    0.7300
   -0.1290
x = pinv(A,0.0001)*b
x =
    1.0001
    0.9983
    1.0055
    0.9981
    0.9955
    0.9974
    1.0007
    1.0034
    1.0043
    1.0030
    0.9996
    0.9941
x = (A+0.0001*eye(n))\b
x =
    0.9999
    1.0017
    0.9977
    0.9961
    0.9989
    1.0030
    1.0060
    1.0068
    1.0050
    1.0007
    0.9942
    0.9859

trigtest
ff = 
    @(x)sin(3*pi*x)-.2*cos(pi*5*x)+sin(pi*x)
    ...
    