Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8605
| From | andres <jarosham@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: extract only positive solutions |
| Date | 2012-02-18 11:34 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jho2c6$5v2$1@smc.vnet.net> (permalink) |
| References | <jhldd0$oql$1@smc.vnet.net> |
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...@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}?
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
extract only positive solutions Gabby Domingo <gbdomingo@gmail.com> - 2012-02-17 11:24 +0000 Re: extract only positive solutions andres <jarosham@gmail.com> - 2012-02-18 11:34 +0000 Re: extract only positive solutions Helen Read <readhpr@gmail.com> - 2012-02-19 11:35 +0000
csiph-web