Got Questions? Get Answers.
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 components

Subject: Matrix components

From: Roberto Garcia

Date: 6 Jan, 2009 15:35:03

Message: 1 of 2

Dear all,

I'm working with matrices. Here is my question when I create a 3x3 matrix of for instance 500 measurements. Then I get a matrix of 1500 x 3.
Here the values from 0-500 correspond to the values of all the first rows
The values from 501-1001 are the values of the second rows.
And finally the values from 1001-1501 are the values of the third rows
If I want to multiply for instance a 1x3 matrix with all these matrices independently, how can I do it?
I tred by myself but my matlab skils are not too developed yet.
Thanks,
Roberto

Subject: Matrix components

From: Roger Stafford

Date: 8 Jan, 2009 03:37:01

Message: 2 of 2

"Roberto Garcia" <r.garcia@student.fontys.nl> wrote in message <gjvtn7$gfc$1@fred.mathworks.com>...
> Dear all,
>
> I'm working with matrices. Here is my question when I create a 3x3 matrix of for instance 500 measurements. Then I get a matrix of 1500 x 3.
> Here the values from 0-500 correspond to the values of all the first rows
> The values from 501-1001 are the values of the second rows.
> And finally the values from 1001-1501 are the values of the third rows
> If I want to multiply for instance a 1x3 matrix with all these matrices independently, how can I do it?
> I tred by myself but my matlab skils are not too developed yet.
> Thanks,
> Roberto

  Call your 1500 x 3 matrix M, and the 1 x 3 matrix p. Based on your (slightly flawed) description of the arrangement of 3 x 3 matrices within M, the k-th such 3 x 3 would be:

 M([0 500 1000]+k,:) or M(500*(0:2)+k,:)

for k = 1 to k = 500, and to do matrix multiplication of p by this would be:

 p*M([0 500 1000]+k,:)

  I can't tell what you intend to do with the 500 resulting 1 x 3 vectors. Perhaps you intend to use them in some manner in a for-loop that advances k from 1 to 500.

Roger Stafford

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