0

I have some question. I have 2 matrix, it's have same size. For example, first matrix : 1

1

0

0

1

0

Second matrix 34

56

12

12

33

14

Then, I want to compare this two matrix and groups it by the criteria on first matrix so I will have this two groups matrix : Matrix when the first matrix is have value 1

34

56

33

and Matrix when the first matrix is have value 0

12

12

14

4

1 に答える 1

0

You could try this:

a = [1 1 0 0 1 0]';
b = [34 56 12 12 33 14]';

b(a==1)
b(a==0)
于 2012-05-04T20:38:21.250 に答える