MathGroup Archive 2002

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

Search the Archive

RE: Plot problem


Frank,

The first method is just to Evaluate the iterator.

FuncList = {Exp[x], Sin[y], z^3};
VarList = {x, y, z};

Do[Plot[FuncList[[i]], Evaluate[{VarList[[i]], -5, 5}]], 
  {i, 1, Length[VarList]}]

But a simpler method is to use functional programming...

MapThread[Plot[#1, {#2, -5, 5}] &, {FuncList, VarList}];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/ 

From: Frank Brand [mailto:frank.brand at t-online.de]
To: mathgroup at smc.vnet.net


Dear colleagues,

how can I solve the following problem: The task is to successively plot 
the functions given in FuncList with the accociated variable


FuncList = {Exp[x], Sin[y], z^3};

VarList = {x, y, z};

Do[Plot[FuncList\[LeftDoubleBracket]
       i\[RightDoubleBracket], {VarList\[LeftDoubleBracket]
         i\[RightDoubleBracket], -5, 5}], {i, 1, Length[VarList]}]]

Thanks in advance
Frank Brand





  • Prev by Date: c++ book
  • Next by Date: Re: Plot problem
  • Previous by thread: Re: Plot problem
  • Next by thread: Re: Plot problem