Re: multiple choice IF condition
- To: mathgroup at smc.vnet.net
- Subject: [mg56437] Re: [mg56427] multiple choice IF condition
- From: Chris Chiasson <chris.chiasson at gmail.com>
- Date: Tue, 26 Apr 2005 01:32:38 -0400 (EDT)
- References: <200504250530.BAA01448@smc.vnet.net>
- Reply-to: Chris Chiasson <chris.chiasson at gmail.com>
- Sender: owner-wri-mathgroup at wolfram.com
a = 0 Table[If[MatchQ[i, 3 | 9 | 10], a += 1], {i, 12}] a What happened to functional programing? On 4/25/05, marloo3 at mail15.com <marloo3 at mail15.com> wrote: > 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 > > -- Chris Chiasson http://chrischiasson.com Kettering University Mechanical Engineering Graduate Student 1 810 265 3161
- References:
- multiple choice IF condition
- From: marloo3@mail15.com
- multiple choice IF condition