% Script P1

clc
randn('seed',0)

disp('Example 1.')
n = 5;
A = randn(n,n); A = A - A';
[Q,T] = SkewReduce(A);
fprintf('\nnorm(Q''Q-I) = %10.3e\n',norm(Q'*Q - eye(n,n)))
fprintf('norm(AQ-QT) = %10.3e',norm(A*Q - Q*T))
Q = Q
T = T

disp('Example 2.')
n = 100;
A = randn(n,n); A = A - A';
[Q,T] = SkewReduce(A);
fprintf('\nnorm(Q''Q-I) = %10.3e\n',norm(Q'*Q - eye(n,n)))
fprintf('norm(AQ-QT) = %10.3e',norm(A*Q - Q*T))
Q = Q(1:5,1:5)
T = T(1:5,1:5)