Re: Stumped again on a simple list
- To: mathgroup at smc.vnet.net
- Subject: [mg32817] Re: Stumped again on a simple list
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Thu, 14 Feb 2002 01:43:35 -0500 (EST)
- References: <a4auba$bu0$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Steven,
Is this the sort of thing that you want?
ii=Table[z,{z,50,140,5}]
{50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140}
ii/.n_Integer\[RuleDelayed] If[n<100,50,200]
{50,50,50,50,50,50,50,50,50,50,200,200,200,200,200,200,200,200,200}
ii/.{n_Integer/;n<100\[RuleDelayed] 50,n_Integer\[RuleDelayed] 200}
{50,50,50,50,50,50,50,50,50,50,200,200,200,200,200,200,200,200,200}
--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
"1.156" <rob at piovere.com> wrote in message news:a4auba$bu0$1 at smc.vnet.net...
> Greetings cypherers all,
>
> I make a simple list ii and I find I can make other lists easily by
algebraic moves like
> jj=ii/2, etc. But when I want make a new list which splits two different
formula, I'm stumped.
>
> Here's a stripped down version to illustrate my problem. I want to use
the value in the original
> array to determine how to make the new array. The If[] is the only thing
I can find to make
> this decision. But, it seems I'm not even close when I try:
>
>
> ii=Table[z,{z,50,1400,5}];
>
> jj=If[ii<100,50,200]
>
> I've looked around a good bit but have not stumbled into any topic that
appears to bear on this problem.
>
> Can I please ask a kind soul to (again) point me in the right direction?
>
> Thanks, Rob
>
>