Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

1 Ansicht (letzte 30 Tage)
Yishun  Wang
Yishun Wang am 14 Mär. 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentare
Said BOUREZG
Said BOUREZG am 14 Mär. 2015
Bearbeitet: Said BOUREZG am 14 Mär. 2015
Hi Yishun Wang, I think in N=10 it follows some rules, but in N=7 no rule here.
Said BOUREZG
Said BOUREZG am 14 Mär. 2015
can you give us an other matrix to see the rules exactly

Antworten (2)

Said BOUREZG
Said BOUREZG am 14 Mär. 2015
Bearbeitet: Said BOUREZG am 14 Mär. 2015
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 am 14 Mär. 2015
Matlab's 'toeplitz' function can simplify this generation greatly.

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by