How to shift the elements of binary matrix?

2 visualizaciones (últimos 30 días)
N M Channabasavayya
N M Channabasavayya el 19 de Abr. de 2019
Comentada: Walter Roberson el 19 de Abr. de 2019
I have a 8*8 binary matrix.
example;
a=[1 0 0 1 0 1 0 1; 0 1 0 0 0 1 1 0; 0 1 0 1 1 0 0 0; 0 1 1 1 1 0 1 0; 1 0 1 0 1 0 1 1; 0 0 0 1 0 1 0 1; 1 0 1 1 0 1 0 0; 1 0 0 1 0 1 1 1];
I want to shift each element of the matrix either right shift or left shift for multiple times, so that the original matrix is altered completely.
How can I do this?
Help me out!
Thank you!
  1 comentario
Walter Roberson
Walter Roberson el 19 de Abr. de 2019
circshift(a, how_far_to_move_right, 2)
circshift(a, -1 * how_far_to_move_left, 2)

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by