1 function U = random_orthogonal_matrix(integerN)
3 % Generate a random orthogonal matrix.
7 % - ``integerN`` -- The dimension of the resulting square matrix.
11 % - ``U`` -- An orthogonal matrix of dimension integerN.
15 % 1. G.W. Stewart, Efficient Generation of Random Orthogonal Matrices,
16 % SIAM J. Numer. Analysis, 1980, pp. 403--409, Section 3.
19 % We begin by computing a random matrix A.
22 % The Q-R decomposition of A will give us an orthogonal factor of A.
23 % See the reference for why this doesn't suck.