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:
Help with an exercise

Subject: Help with an exercise

From: Diana M

Date: 20 May, 2010 22:10:04

Message: 1 of 3

Could anyone solve this problem? I'd be very grateful if someone could find the solution...

I have a matrix 16x16 and I have to make one other matrix with all the combinations of 8x8 matrixes.

For example (in a smaller scale):
It is given the matriz A=
 x1 x2 x3 x4
x5 x6 x7 x8
x9 x10 x11 x12
x13 x14 x15 x16

and I want to do another matriz with all the combinations of matrixes 2x2. It will be these two matrixes:

1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 x x1
0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 x2
0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 x3
0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 x4
0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 x5
0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 x6
0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 x7
0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 x8
0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 x9
                                                       x10
                                                       x11
                                                      x12
                                                      (...)
                                                      x16

Maybe there are more possible combinations that those ones I did...
The idea is to create a function that gives me the first matrix (the one with zeros and ones) but to a matrix A 16x16 (can't be made manually).

Thank you

Subject: Help with an exercise

From: John D'Errico

Date: 20 May, 2010 22:55:05

Message: 2 of 3

"Diana M" <diana_mourao@hotmail.com> wrote in message <ht4bvs$frf$1@fred.mathworks.com>...
> Could anyone solve this problem? I'd be very grateful if someone could find the solution...
>
> I have a matrix 16x16 and I have to make one other matrix with all the combinations of 8x8 matrixes.
>
> For example (in a smaller scale):
> It is given the matriz A=
> x1 x2 x3 x4
> x5 x6 x7 x8
> x9 x10 x11 x12
> x13 x14 x15 x16
>
> and I want to do another matriz with all the combinations of matrixes 2x2. It will be these two matrixes:
>
> 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 x x1
> 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 x2
> 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 x3
> 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 x4
> 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 x5
> 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 x6
> 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 x7
> 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 x8
> 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 x9
> x10
> x11
> x12
> (...)
> x16
>
> Maybe there are more possible combinations that those ones I did...
> The idea is to create a function that gives me the first matrix (the one with zeros and ones) but to a matrix A 16x16 (can't be made manually).
>
> Thank you

But what have YOU tried? This is your homework
assignment. The way to learn matlab, or any such
programming tool, is to use it yourself.

John

Subject: Help with an exercise

From: Roger Stafford

Date: 20 May, 2010 23:13:03

Message: 3 of 3

"Diana M" <diana_mourao@hotmail.com> wrote in message <ht4bvs$frf$1@fred.mathworks.com>...
> Could anyone solve this problem? I'd be very grateful if someone could find the solution...
>
> I have a matrix 16x16 and I have to make one other matrix with all the combinations of 8x8 matrixes.
>
> For example (in a smaller scale):
> It is given the matriz A=
> x1 x2 x3 x4
> x5 x6 x7 x8
> x9 x10 x11 x12
> x13 x14 x15 x16
>
> and I want to do another matriz with all the combinations of matrixes 2x2. It will be these two matrixes:
>
> 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 x x1
> 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 x2
> 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 x3
> 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 x4
> 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 x5
> 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 x6
> 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 x7
> 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 x8
> 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 x9
> x10
> x11
> x12
> (...)
> x16
>
> Maybe there are more possible combinations that those ones I did...
> The idea is to create a function that gives me the first matrix (the one with zeros and ones) but to a matrix A 16x16 (can't be made manually).
>
> Thank you

  If I understand your problem, I calculate there should be:

 36 = (4!/(2!*2!))^2

different kinds of 2 x 2 submatrices that can be made out of a 4 x 4 one. Hint: the quantity 4!/(2!*2!) is the number of combinations of two things taken out of a set of four things. Why did I take its square?

  Another hint. There is a matlab function called 'nchoosek' which should be of considerable interest to you.

Roger Stafford

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