Re: multiple choice IF condition
- To: mathgroup at smc.vnet.net
- Subject: [mg56460] Re: [mg56427] multiple choice IF condition
- From: "David Park" <djmp at earthlink.net>
- Date: Tue, 26 Apr 2005 01:33:15 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Mark, a = 0; Table[If[MatchQ[i, 3 | 5 | 9 | 18], a = a + i], {i, 20}] David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: marloo3 at mail15.com [mailto:marloo3 at mail15.com] To: mathgroup at smc.vnet.net could we have a more practical way than this way of choosing some numbers of the choice: a = 0; Table[If[i == 3 || i == 5 || i == 9 || i==18, a = a + i], {i, 20}] ie: i wish if it is possible like this: If[i==3 ||5 ||9||18, ...] Thanks very much mark
- Follow-Ups:
- Re: Re: multiple choice IF condition
- From: DrBob <drbob@bigfoot.com>
- Re: Re: multiple choice IF condition