MathGroup Archive 2005

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

Search the Archive

Re: Re: Re: Language vs. Library


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