MathGroup Archive 1999

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

Search the Archive

Help needed


I'm a new Mathematica (3.0) user.  The program is listed below.  The
problem is that the last command (For loop) gives me no output.  But it
works if I input a specific number, 1 to 4, to substitute i in
"Apply[mag,{Watoms[[i]],Gatoms[[i]]}]".  

Thanks.  

Bin


watoms= Table[{{0,0,0},{0.5,-0.5,0.5},{0.5,0.5,0.5},{0,0,1}}]
Bao = 2.8665;  
Watoms =watoms*Bao;

gatoms=Table[ {{0,0,0},{0.5,-0.5,0.5},{0.5,0.5,0.5},{0,0,1}}]
Fao = 3.5975
Gatoms =gatoms*Fao

mag[{a1_,a2_,a3_},{b1_,b2_,b3_}]:=Sqrt[(a1-b1)^2+(a2-b2)^2+(a3-b3)^2]

For[i=1,i<5,i++,Apply[mag,{Watoms[[i]],Gatoms[[i]]}]]


  • Prev by Date: Dialog boxes
  • Next by Date: RE: ARghh!!
  • Previous by thread: Re: Dialog boxes
  • Next by thread: Re: Help needed