Help needed
- To: mathgroup at smc.vnet.net
- Subject: [mg18801] Help needed
- From: Bin Liu <binliu at vt.edu>
- Date: Thu, 22 Jul 1999 08:19:22 -0400
- Organization: Virginia Tech
- Sender: owner-wri-mathgroup at wolfram.com
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]]}]]