Re: Re: Re: Language vs. Library
- To: mathgroup at smc.vnet.net
- Subject: [mg61250] Re: [mg61236] Re: Re: Language vs. Library
- From: "David Annetts" <davidannetts at aapt.net.au>
- Date: Fri, 14 Oct 2005 05:53:36 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hi Steve, > > Try this: > > A = Array[a (10#1 + #2) &, {3, 3}] > v = {x, y, z} > A.v // MatrixForm > Clear[A,v]; > A = Array[a (10#1 + #2) &, {3, 3}] // MatrixForm v = {x, y, > z} // MatrixForm A.v > > Why are the results different? This code is actually working properly. If you meant to show the calculation in matrix form, then what you should have written in the second part of the example was MatrixForm[A = Array[a (10#1 + #2) &, {3, 3}]] MatrixForm[v = {x, y, z}] MatrixForm[A.v] > > Explain this: > > Clear[a, i] > a[i] = eye; > i = 3; > a[3] = three; > Print["a[i]=", a[i]] > Clear[i]; > Print["a[i]=", a[i]] This is also working correctly. Although you've cleared i, you haven't cleared the symbol a[i]. You can see this by evaluating ??a after your final Print[]. You might also want to try a similar trick with i Regards, Dave.