MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

removing non-numeric elements from the table

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108016] removing non-numeric elements from the table
  • From: michael partensky <partensky at gmail.com>
  • Date: Fri, 5 Mar 2010 04:33:34 -0500 (EST)

Hi. I am building a large table filled with the numerical solutions of an equation.
Here is an example, where a normal standard variable is being generated.


rnd:=Random[];
Eq:=Solve[1/2 (Erf[z/Sqrt[2]]+1)==2 rnd-1,z];
tvR=Quiet[Table[z/.Eq[[1]],{20}]];

In[187]:=
tvR

Out[187]=
{0.761439, z /. {}[[1]], z /. {}[[1]], 1.07111, 0.031784, z /. {}[[1]], z /.
{}[[1]], 0.808313, -1.04238, z /. {}[[1]], 0.376982, z /. {}[[1]], 1.06622,
z /. {}[[1]], -0.546643, -0.367224, 0.28111, -0.0606866, z /. {}[[1]], z /.
{}[[1]]}

What is a nicer way of removing the non-numeric elements? Clearly, it is
possible to filter them out using say NumericQ, but I am looking for
something more elegant (it is apart of a lecture), preferably right while
the Table is being generated.

Thanks
Michael



  • Prev by Date: Re: Typesetting
  • Next by Date: Re: Mathematica and LaTeX
  • Previous by thread: Question about Three Dimensions Partial Differential Equation (PDE)
  • Next by thread: Re: removing non-numeric elements from the table