Dx=1; Dy=1; N = 100; sg = 0.1; A = randn(Dy,Dx); b = randn(Dy,1); X=randn(1,N); Y = A*X+b + sg*randn(1,N); [A,b] = LSRegression(X,Y)