7

How to generate an orthogonal matrix in Octave?

I saw something like that

gallery('orthog',n,k)

in matlab, but I can't find any similar function in Octave.

Thanks!

skorek
  • 75
  • 2
    For those of you who land here today, octave has been extended since the answer was given. There is now a gallery("orthog",n,k) command in octave; see doc gallery. However, it should be noted that for a given n, the matrix returned is fixed. It is not random. – Armadillo Jim Jul 27 '15 at 20:54

1 Answers1

7
  1. You can apply QR to a given random matrix: [q, r] = qr (a). The matrix q will be orthogonal.
  2. You can use orthogonal basis computation: Q = orth(A) on a random matrix A.