4.0

4.0 | 3 ratings Rate this file 23 Downloads (last 30 days) File Size: 1.13 KB File ID: #11783

RandOrthMat

by Ofek Shilon

 

25 Jul 2006 (Updated 06 Sep 2006)

Generates a random orthogonal (real) square matrix of given size.

| Watch this File

File Information
Description

M = RANDORTHMAT(n)
Generates a random n x n orthogonal real matrix.

M = RANDORTHMAT(n,tol)
Explicitly specifies a thresh value that measures linear dependence of a newly formed column with the existing columns. Defaults to 1e-6.

The generated matrix distribution is now (as of Sept 06) uniform over the manifold O(n) w.r.t. the induced R^(n^2) Lebesgue measure. Thanks to Roger Stafford and his randsphere for the idea.

MATLAB release MATLAB 7.2 (R2006a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
27 Jul 2006 John D'Errico

Its based on a reasonable choice of algorithm. I like that it has a default tolerance, and watches for problems in the matrix generation. Good help.

13 Oct 2010 Jesus Puente

This is slower than generating a random nxn matrix, computing its qr decomposition and returning q

01 Dec 2011 dberm22

Just what I was looking for! Thanks!

Please login to add a comment or rating.
Updates
31 Jul 2006

Minor performence improvements, descriptions updadated.

05 Sep 2006

Algorithm modified to generate orthogonal matrices uniformly.

06 Sep 2006

bug fix - rand replaced with randn.

Tag Activity for this File
Tag Applied By Date/Time
matrices Ofek Shilon 22 Oct 2008 08:33:29
random orthogonal matrix linear algebra algorithm tests Ofek Shilon 22 Oct 2008 08:33:29

Contact us at files@mathworks.com