Re: Behavior of Array[]
- To: mathgroup at smc.vnet.net
- Subject: [mg19507] Re: Behavior of Array[]
- From: "David Bailey" <dave-bailey at freeuk.com>
- Date: Sat, 28 Aug 1999 15:53:24 -0400
- References: <7q20js$q91@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Joseph C. Slater wrote in message <7q20js$q91 at smc.vnet.net>... >I've been using Mathematica for many years and one thing still puzzles me. >Elements of the array defined by the variable 'a' can be obtained using >a[[i,j]]=expression. However, the command Array creates arrays comprised >of elements named in the form 'a[i,j]'. Note the single brackets. >Everything I see in the Mathematica book about brackets says that these >are functions. This seems inconsistant to me. Shouldn't they be listed as >'a[[i,j]]' until they are defined? What are the single brackets supposed >to mean if not elements of the array 'a'? >Thanks in advance, > The command Array[a, {3, 3}] should not be thought of as setting up the array a, but using the function a[#1,#2]& to set up the elements of an array - which you could then assign to anything - say b. If you try a construct such as Array[Fibonacci, 8] this relationship should become more obvious. David Bailey Salford Software