Shift a square matrix along a bigger square matrix by one

5 views (last 30 days)
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.
John D'Errico
John D'Errico on 30 Nov 2022
Please give an example. Even the clarification comment you made is highly confusing.

Sign in to comment.

Answers (2)

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

DGM on 30 Nov 2022
Edited: DGM on 8 Dec 2022


Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by