Re: patterns
- To: mathgroup at smc.vnet.net
- Subject: [mg3733] Re: [mg3727] patterns
- From: Robert Pratt <rpratt at math.unc.edu>
- Date: Sun, 14 Apr 1996 02:59:35 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Use the following command:
Select[list, Denominator[#]==r &]
Mma will return a sublist whose members all have denominator r.
Rob Pratt
Department of Mathematics
The University of North Carolina at Chapel Hill
CB# 3250, 331 Phillips Hall
Chapel Hill, NC 27599-3250
rpratt at math.unc.edu
On Thu, 11 Apr 1996, Susan Rempe wrote:
>
> I have a list of numbers and symbols.
> How can I collect all the members of the list
> which have a common denominator?
>
> ex. list={Sin[theta]/r, Cos[theta]/(r*s), 2*Csc[theta]/(2*r)}
>
> Say I want to collect all members of the list with r in the denominator;
>
> i.e. answer=Sin[theta]/r;
>
> ********************************************
> Susan Rempe *
> University of Washington *
> Department of Chemistry *
> Box 351700 *
> Seattle, WA 98195-1700 *
> *
> (206)685-2951 *
> rempe at u.washington.edu *
> ********************************************
>
>
>
==== [MESSAGE SEPARATOR] ====