Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

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.


  • Prev by Date: Re: How to reverse sign on the y's in a list of (x, y)'s?
  • Next by Date: Re: big integer for Range
  • Previous by thread: Re: Language vs. Library
  • Next by thread: Re: Language vs. Library