Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8600 > unrolled thread
| Started by | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| First post | 2012-02-18 11:31 +0000 |
| Last post | 2012-02-18 11:31 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: extract only positive solutions Bob Hanlon <hanlonr357@gmail.com> - 2012-02-18 11:31 +0000
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Date | 2012-02-18 11:31 +0000 |
| Subject | Re: extract only positive solutions |
| Message-ID | <jho27c$5to$1@smc.vnet.net> |
sol = {{-.532, .932}, {.34, 23}};
Select[sol, And @@ Positive[#] &]
{{0.34, 23}}
Cases[sol, _?(And @@ Positive[#] &)]
{{0.34, 23}}
Cases[sol, {_?Positive ..}]
{{0.34, 23}}
DeleteCases[sol, {___, _?NonPositive, ___}]
{{0.34, 23}}
DeleteCases[sol, _?(Or @@ NonPositive[#] &)]
{{0.34, 23}}
Bob Hanlon
On Fri, Feb 17, 2012 at 6:23 AM, Gabby Domingo <gbdomingo@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 top | Article view | comp.soft-sys.math.mathematica
csiph-web