Re: loop for with plot
- To: mathgroup at smc.vnet.net
- Subject: [mg110041] Re: loop for with plot
- From: "David Park" <djmpark at comcast.net>
- Date: Sun, 30 May 2010 23:44:31 -0400 (EDT)
You can use the much simpler Table instead of For. It is usually good to evaluate the functions you are plotting before putting them into a Plot statement. So: R3 = 6; functions = Table[2*R3*Sin[ArcCos[x/R3]]*e3, {e3, 0, 3}] Plot[functions, {x, -2 R3, 2 R3}] David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ From: maria giovanna dainotti [mailto:mariagiovannadainotti at yahoo.it] Dear Mathgroup, when I am using the loop for with plot is not working. here is the example R1=1.029 R2=3 R3=6 e1=27 e2=0 e3=2.5 For[e3=0,e3<4,e3++,Plot[{2*R3*Sin[ArcCos[x/R3]]*e3}, {x, -2R3,2 R3}]] How can I sort out the problem? Best regards Maria