Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15458

Re: ReplacePart -> eliminate

From Bill Rowe <readnews@sbcglobal.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: ReplacePart -> eliminate
Date 2013-09-17 09:30 +0000
Message-ID <l197g4$97l$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


On 9/16/13 at 5:27 AM, Roberto.Brambilla@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)}

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: ReplacePart -> eliminate Bill Rowe <readnews@sbcglobal.net> - 2013-09-17 09:30 +0000

csiph-web