% Script P2
% Checks out MyExpM
clc
randn('seed',0)
format short

% Generate a small random example
disp('Example 1.')
n = 7;
A = randn(n,n);
T = schur(A)
F = MyExpM(T)
Fexact = expm(T)

%  Larger example...
disp('Example 2.')
n = 21;
A = randn(n,n);
T = schur(A);
F = MyExpM(T);
Fexact = expm(T);
fprintf('norm(expm(T) - MyExpM(T) = %10.3e\n', norm(F - Fexact))