Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Matrix Transformation

Subject: Matrix Transformation

From: Jamie Macdonald

Date: 13 Dec, 2010 22:14:06

Message: 1 of 3

Hello, I was wondering if there is a way to "translate" a matrix of the form [0 1 0; 0 1 0; 0 1 0] to [1 0 0; 1 0 0; 0 1 0] or [0 0 1; 0 0 1; 0 0 1]; i.e. shifting each column to the next column left or right & "loop around" and the same thing for rows up or down.

I want to be able to have only one "original" matrix to call for these translations.

Thank you for your help.

Subject: Matrix Transformation

From: Sean de

Date: 13 Dec, 2010 22:26:20

Message: 2 of 3

"Jamie Macdonald" <jamie.alban@gmail.com> wrote in message <ie65re$kn0$1@fred.mathworks.com>...
> Hello, I was wondering if there is a way to "translate" a matrix of the form [0 1 0; 0 1 0; 0 1 0] to [1 0 0; 1 0 0; 0 1 0] or [0 0 1; 0 0 1; 0 0 1]; i.e. shifting each column to the next column left or right & "loop around" and the same thing for rows up or down.
>
> I want to be able to have only one "original" matrix to call for these translations.
>
> Thank you for your help.

doc circshift

Subject: Matrix Transformation

From: Walter Roberson

Date: 13 Dec, 2010 23:20:14

Message: 3 of 3

On 10-12-13 04:14 PM, Jamie Macdonald wrote:
> Hello, I was wondering if there is a way to "translate" a matrix of the form
> [0 1 0; 0 1 0; 0 1 0] to [1 0 0; 1 0 0; 0 1 0] or [0 0 1; 0 0 1; 0 0 1]; i.e.
> shifting each column to the next column left or right & "loop around" and the
> same thing for rows up or down.
>
> I want to be able to have only one "original" matrix to call for these
> translations.

circshift() ?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us