Re: Help! Delete Casses based on column
- To: mathgroup at smc.vnet.net
- Subject: [mg58304] Re: Help! Delete Casses based on column
- From: "dkr" <dkrjeg at adelphia.net>
- Date: Sun, 26 Jun 2005 23:13:07 -0400 (EDT)
- References: <d9lfee$13q$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In[51]:= f[m_,n_Integer,x_?NumberQ]:=m/.a_List/;a[[n]]<x:>Sequence[]; In[52]:= mat={{1,2,3},{4,5,6},{7,8,9},{10,11,12}}; Col=2; X=8; f[mat,Col,X] Out[54]= {{7,8,9},{10,11,12}} Alternatively: In[56]:= f[m_,n_Integer,x_?NumberQ]:= ReplacePart[m,Hold[], Position[Transpose[m][[n]], a_/;a<x]]//ReleaseHold; In[57]:= f[mat,Col,X] Out[57]= {{7,8,9},{10,11,12}}