# Random Generation of Binary Orthogonal Matrix of Size n * n with Matlab

조회 수: 23(최근 30일)
Hiba Basim Alwan 24 Feb 2018
Commented: Uri Cohen 25 Jul 2019
Dear all...
How can I generate random binary orthogonal matrix of size n * n with matlab?
Regards,

로그인 to comment.

### 채택된 답변

Guillaume 24 Feb 2018
James Tursa 님이 편집함. 22 Mar 2018
I'm not a mathematician so I could be completely wrong but aren't square binary orthogonal matrices just permutations of the rows (or columns) of the identity matrix?
If yes,
m = eye(n);
m = m(randperm(n), :)
This certainly generates random binary orthogonal matrices of size nxn. Whether it can generate all the possible ones, I don't know.

#### 댓글 수: 2

Hiba Basim Alwan 22 Mar 2018
Thank you so much for your helping.
Uri Cohen 25 Jul 2019
No, they are not.

로그인 to comment.

Hi Hiba Basim Alwan
C = rand(10)
Y = round(C)

#### 댓글 수: 1

Guillaume 24 Feb 2018
That does produce a matrix that is binary and random, but certainly not orthogonal (which is the difficult bit of the question).
randi([0 1], n)
is a simpler way of producing a binary matrix.

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

Translated by