q)*Q(:,1);
Q(:,2) = v/norm(v);
%% 
% On the next pass, we have to subtract off the projections in two previous 
% directions.
%%
Aq = A*Q(:,2);
v = Aq - (Q(:,1)'*Aq)*Q(:,1) - (Q(:,2)'*Aq)*Q(:,2);
Q(:,3) = v/norm(v);
%% 
% At every step, $\mathbf{Q}_m$ is an ONC matrix.
%%
norm( Q'*Q - eye(3) )
%% 
% And $\mathbf{Q}_m$ spans the same space as the 3-dimensional Krylov matrix.
%%
K = [ u A*u A*A*u ];
rank( [Q,K] )
##### SOURCE END #####
--></body></html>