Shift a square matrix along a bigger square matrix by one

1 visualización (últimos 30 días)
Randa
Randa el 30 de Nov. de 2022
Editada: DGM el 8 de Dic. de 2022
Let’s say I have a matrix,call it m2 with size of 4x4. I want to shift the matrix by one using for loop.
  2 comentarios
KSSV
KSSV el 30 de Nov. de 2022
What do you mean by shift the matrix? Any example?
John D'Errico
John D'Errico el 30 de Nov. de 2022
Please give an example. Even the clarification comment you made is highly confusing.

Iniciar sesión para comentar.

Respuestas (2)

Bjorn Gustavsson
Bjorn Gustavsson el 30 de Nov. de 2022
Have a look at the help and documentation for the function circshift. That function should solve the problem you have described.
HTH

DGM
DGM el 30 de Nov. de 2022
Editada: DGM el 8 de Dic. de 2022

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by