Example, given Matrix
1 9 0 10 5 6 7 8 3 9 2 10
Select rows which has \(9\) in the second column and \(10\) in the last column. Hence the result will be the first and third rows only
1 9 0 10 3 9 2 10
Mathematica mat={{1,9,0,10}, {5,6,7,8}, {3,9,2,10}}; p = Position[mat[[All,{2,4}]],x_/;x==={9,10}]
|
{{1},{3}}
|
Extract[mat,p]
|
{{1,9,0,10}, {3,9,2,10}} |
Matlab A=[1 9 0 10; 5 6 7 8; 3 9 2 10]; r=bsxfun(@eq,A(:,[2 4]),[9 10]); ind=all(r,2); A(ind,:)
|
ans = 1 9 0 10 3 9 2 10 |
There does not seem to be a direct way in Maple to take list of row Vectors, and use these to make a Matrix. This is why I had to convert to list in the above to make it work.