How do I create a (n x n) matrix whose elements alternate 1 or 0?

How do I create a (n x n) matrix whose elements are either 1 or 0 such that the value of each element is different from its adjacent elements, both from those above and below it and from those on either side of it.

Etiquetas

Aún no se han introducido etiquetas.

Preguntada:

el 4 de Abr. de 2015

Respondida:

el 4 de Abr. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by