Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I generate this tyope of matrix as shows in the follow

1 回表示 (過去 30 日間)
Yishun  Wang
Yishun Wang 2015 年 3 月 14 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I don't even know how to describe this matrix but it follows some rules. How can I generate a N*N matrix like follows. This is an example when N=8 and N=10. N is the only variable. Can anyone help me to generate matrix like follows when the value of N is given ? This is when=9 A =
0 1 1 0 1 1 0 1
1 0 1 1 0 1 1 0
1 1 0 1 1 0 1 1
0 1 1 0 1 1 0 1
1 0 1 1 0 1 1 0
1 1 0 1 1 0 1 1
0 1 1 0 1 1 0 1
1 0 1 1 0 1 1 0
When N=7
A =
0 1 1 0 1 1 1
1 0 1 1 0 1 1
1 1 0 1 1 0 0
0 1 1 0 1 1 1
1 0 1 1 0 1 1
1 1 0 1 1 0 1
1 1 1 0 1 1 0
  2 件のコメント
Said BOUREZG
Said BOUREZG 2015 年 3 月 14 日
編集済み: Said BOUREZG 2015 年 3 月 14 日
Hi Yishun Wang, I think in N=10 it follows some rules, but in N=7 no rule here.
Said BOUREZG
Said BOUREZG 2015 年 3 月 14 日
can you give us an other matrix to see the rules exactly

回答 (2 件)

Said BOUREZG
Said BOUREZG 2015 年 3 月 14 日
編集済み: Said BOUREZG 2015 年 3 月 14 日
This attached function can help you, b = spematrix(9)
b =
0 1 1 0 1 1 0 1 1
1 0 1 1 0 1 1 0 1
1 1 0 1 1 0 1 1 0
0 1 1 0 1 1 0 1 1
1 0 1 1 0 1 1 0 1
1 1 0 1 1 0 1 1 0
0 1 1 0 1 1 0 1 1
1 0 1 1 0 1 1 0 1
1 1 0 1 1 0 1 1 0

Roger Stafford
Roger Stafford 2015 年 3 月 14 日
Matlab's 'toeplitz' function can simplify this generation greatly.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by