MathGroup Archive 2012

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

Search the Archive

Re: extract only positive solutions


I don't fully understand, NSolve (or any solver) gives the solutions
as a set of rules, not as a list of numbers.
>From your example I guess you want to extract the pairs whose first
element is > 0. If that's the case I'd use Select:
Select[sol, #[[1]] > 0 &]
Andr=E9s

On Feb 17, 6:24 am, Gabby Domingo <gbdomi... at gmail.com> wrote:
> hi all! how do you extract only positive solutions to a solver, like
> NSolve?
>
> sol={{-.532,.932},{.34,23}}
>
> and extract {.34,.23}?




  • Prev by Date: Re: extract only positive solutions
  • Next by Date: Re: Documentation for GridBoxSpacings
  • Previous by thread: Re: extract only positive solutions
  • Next by thread: Re: extract only positive solutions