Re: Functional programming
- To: mathgroup at smc.vnet.net
- Subject: [mg39076] Re: Functional programming
- From: Bill Rowe <listuser at earthlink.net>
- Date: Sun, 26 Jan 2003 18:44:24 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
On 1/26/03 at 5:22 AM, _NOzturner0826SPAM_ at hotmail.com (Zachary Turner) wrote: >"Allan Hayes" <hay at haystack.demon.co.uk> wrote in message >news:b0tb14$9c8$1 at smc.vnet.net... >>"Zachary Turner" <_NOzturner0826SPAM_ at hotmail.com> wrote in message >>news:b0r496$4lo$1 at smc.vnet.net... > > >I have a function f[a_,b_] defined some way. i want to fix one > > >argument, and then generate an array of values where the other > > >argument varies. How can I do this? >>Table[f[x,4],{x,1,4}] >>{f[1, 4], f[2, 4], f[3, 4], f[4, 4]} >Good lord. I didn't expect this many responses :) Anyway, the Table >method seems the simplest. Now I extend on this a little bit. Is >there any way I can apply FullSimplify to the result before it gets >inserted into the array? Try Table[FullSimplify[f[x,4]],{x,1,4}] or FullSimplify[f[#,4]]&/@Range[4]