# Trefethen & Bau, page 64
from pylab import *

x = linspace(-1.0,1.0,257).reshape((257,1))
A = concatenate((x**0, x**1, x**2, x**3),axis=1)
[Q,R] = qr(A)

scale = Q[256,:]
Q = dot(Q,diag(1.0 / scale))
plot(Q), show()
