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:
Remapping a Matrix.

Subject: Remapping a Matrix.

From: Sumeer

Date: 31 Mar, 2010 09:10:06

Message: 1 of 4

Hi Guys,
New user to Matlab. I have to write an engineering program in Matlab, & need to remap entries in 3 different 6x6 matrices, to make a large 18x18 matrix. Any suggestions on how I might go about this?
regards
Sumeer

Subject: Remapping a Matrix.

From: Sadik

Date: 31 Mar, 2010 09:55:07

Message: 2 of 4

Hi Sameer,

Are you sure it will be 18x18? Because 6x6x3 can give 18x6 or 6x18.

In any case, you can use reshape() after concatenating the matrices as follows:

matrix3D = zeros(6,6,3);
matrix3D(:,:,1) = A;
matrix3D(:,:,2) = B;
matrix3D(:,:,3) = C;

newMatrix = reshape(matrix3D,[18 6]); % or any other dimension, but still keeping 108 elements

Best.

Subject: Remapping a Matrix.

From: James Tursa

Date: 31 Mar, 2010 15:41:04

Message: 3 of 4

"Sumeer " <zippystokes@hotmail.com> wrote in message <hov3he$p5f$1@fred.mathworks.com>...
> Hi Guys,
> New user to Matlab. I have to write an engineering program in Matlab, & need to remap entries in 3 different 6x6 matrices, to make a large 18x18 matrix. Any suggestions on how I might go about this?
> regards
> Sumeer

Not sure how you want them combined from your limited post. Generally you can use the [ ; ] operation (concatenation) to do this. Since this is an engineering problem and you have only given us three pieces, I am guessing that this is a symmetric system. If so, then you can do this:

A = upper left 6 x 6 block.
C = lower left 6 x 6 block.
D = upper right 6 x 6 block.

M = [A C'; C D]

If this is not what you want then please post a more detailed question.

James Tursa

Subject: Remapping a Matrix.

From: Sumeer

Date: 2 Apr, 2010 02:52:06

Message: 4 of 4

"James Tursa" <aclassyguy_with_a_k_not_a_c@hotmail.com> wrote in message <hovqeg$p0s$1@fred.mathworks.com>...
> "Sumeer " <zippystokes@hotmail.com> wrote in message <hov3he$p5f$1@fred.mathworks.com>...
> > Hi Guys,
> > New user to Matlab. I have to write an engineering program in Matlab, & need to remap entries in 3 different 6x6 matrices, to make a large 18x18 matrix. Any suggestions on how I might go about this?
> > regards
> > Sumeer
>
> Not sure how you want them combined from your limited post. Generally you can use the [ ; ] operation (concatenation) to do this. Since this is an engineering problem and you have only given us three pieces, I am guessing that this is a symmetric system. If so, then you can do this:
>
> A = upper left 6 x 6 block.
> C = lower left 6 x 6 block.
> D = upper right 6 x 6 block.
>
> M = [A C'; C D]
>
> If this is not what you want then please post a more detailed question.
>
> James Tursa

Hi Guys, thanks for your responses, I have been able to work out what I need to do to solve my problem. Thanks for your help.
regards Sumeer

Tags for this Thread

No tags are associated with 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