MathGroup Archive 2012

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

Search the Archive

Re: extract only positive solutions


On 2/17/12 at 6:23 AM, gbdomingo at gmail.com (Gabby Domingo) wrote:

>hi all! how do you extract only positive solutions to a solver, like
>NSolve?

>sol={{-.532,.932},{.34,23}}

>and extract {.34,.23}?

Here is an example of one way

In[3]:= p = (x + 3) (x - 4) (x - 5) // Expand;

In[4]:= Cases[Solve[p == 0, x], {_?(x > 0 /. # &)}]

Out[4]= {{x->4},{x->5}}




  • Prev by Date: multiple selection control
  • Next by Date: Re: extract only positive solutions
  • Previous by thread: Re: extract only positive solutions
  • Next by thread: Re: extract only positive solutions