% Try using MATLAB's "jordan" command to compute the Jordan form of this matrix

% J = diag([1 1 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 0 1 0],1);  % 6 jordan blocks
% J = diag([1 1 1 1 0 1 1 1 0 1 1 0 1 0],1);              % 5 jordan blocks
 J = diag([1 1 1 0 1 1 0 1 0],1);                         % 4 jordan blocks
 n = size(J,1);
 X = triu(randn(n));
 A = X*J/X;
