Re: ReplacePart -> eliminate
- To: mathgroup at smc.vnet.net
- Subject: [mg131659] Re: ReplacePart -> eliminate
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Tue, 17 Sep 2013 21:34:12 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
On 9/16/13 at 5:27 AM, Roberto.Brambilla at rse-web.it (Brambilla
Roberto Luigi (RSE)) wrote:
>I'd like to eliminate the Indeterminate (or other non-numerical
>terms, as Infinite, etc...) items. Es.
>x = {-1.25664, 0.628319, -0.628319, 1.25664, Indeterminate, -1.25664,
>0.628319, -0.628319, 1.25664, Indeterminate};
>or
>x=Table[1/(3 - n), {n, 0, 5}]) {1/3, 1/2, 1, ComplexInfinity,
>-1,-1/2}
>How can I do it with a simple command?
In[1]:= x = {-1.25664, 0.628319, -0.628319, 1.25664,
Indeterminate, -1.25664, 0.628319, -0.628319, 1.25664,
Indeterminate};
Cases[x, _?NumericQ]
Out[2]= {-1.25664,0.628319,-0.628319,1.25664,-1.25664,0.628319,-0.628319, 1.25664}
In[3]:= x = Table[1/(3 - n), {n, 0, 5}];
Cases[x, _?NumericQ]
Out[4]= {1/3, 1/2, 1, -1, -(1/2)}