MATLAB: Selecting specific Inputs to put in another matrix

choose inputs matrix

i have this
X=
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
what can i do if to put for example the 1st the 3rd row in another matrix???

Best Answer

Here is one way:
X = [0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1];
Y = X([1 3],:)
producing:
Y =
0 0 0
0 1 0
Is this what you want to do?
Related Question