Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6946
| From | "Harvey P. Dale" <hpd1@nyu.edu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: How to get elements satisfying specific condition from a list |
| Date | 2011-12-05 10:31 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jbi6i3$52t$1@smc.vnet.net> (permalink) |
| References | <201112040751.CAA21566@smc.vnet.net> |
You can use "Select" to do this. For example:
Select[Table[{x, y}, {x, 1, 6}, {y, 1, 6}], Total[#]>9&]
will give you your first desired result, and
Select[Range[9], Sqrt[#]>2&]
will give you your second desired result.
Best,
Harvey
-----Original Message-----
From: e-changb [mailto:e-changb@hanmail.net]
Sent: Sunday, December 04, 2011 2:51 AM
Subject: How to get elements satisfying specific condition
from a list
Hi, please help me if you can.. Let
B:= Table[{x, y}, {x, 1, 6}, {y, 1, 6}]
It is clear that B has 36 elements.
I want to get the list of elements satisfying 'the first component +
second component is bigger than 9'
so that the answer is
{{5,5},{5,6},{6,5},{6,6}}.
In fact, I have no idea for following even simpler problem. : Let A be a
set of all natural numbers less than 10. Find every element whose squre
root is bigger than 2. (needless to say the answer is {5,6,7,8,9})
Can you help me ?
Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread
Re: How to get elements satisfying specific condition from a list "Harvey P. Dale" <hpd1@nyu.edu> - 2011-12-05 10:31 +0000 Re: How to get elements satisfying specific condition from a list "Nasser M. Abbasi" <nma@12000.org> - 2011-12-06 08:18 +0000
csiph-web