I have a matrix:
`MT={{1, 54, 55}, {2, 841, 5}, {3, 6, 65}, {4, 28, 328}, {5, 188, 21}, {6, 2, 887}, {7, 36, 32}, {8, 7, 2}}`
And i need select the list which the 1st Raw WL={1,5,7,8}
The result will be {{1, 54, 55}, {5, 188, 21}, {7, 36, 32}, {8, 7, 2}}
But I want to save the executing time from the code:
Catenate[Table[
Select[MT, #[[1]] == WL[[i]] &], {i, Dimensions[WL][[1]]}]]
By this method, when Dimension[WL]
too long, the executing time also become longer.
Does any method or function can easily save the executing time from this case?
MT[[WL]]
will do it for your example. $\endgroup$