Message Boards Message Boards

0
|
3782 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Dropping rows of matrix whose 3rd element is smaller than a number

I have an M X N matrix, I want to drop/delete all the rows whose 3rd element is less than 10^6, how I do I do it?

I tried putting conditional statement inside Drop command, and Pick command but so far I have only managed to get errors.

POSTED BY: Nilanjan Banik
m = {{1, 2, 3}, {3, 2, 10^8}, {4, 1, 5}, {10, 20, 10^10}};

In[5]:= Select[m, #[[3]] > 10^6 &]

Out[5]= {{3, 2, 100000000}, {10, 20, 10000000000}}
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract