Adjusting parameters of a function using Plot command
- To: mathgroup at smc.vnet.net
- Subject: [mg94750] Adjusting parameters of a function using Plot command
- From: "Tugrul Temel" <temelt at xs4all.nl>
- Date: Mon, 22 Dec 2008 06:21:31 -0500 (EST)
Dear All, Few days ago, David Park communicated the following code with the Forum: ************** testFunc[expr_, vars_] := Module[ {newFunc, args, i, p, plotf}, newFunc = Apply[Plus, expr] /. vars[[1]] -> p; Print[newFunc]; args := Join[{plotf[newFunc, {p, 0, 10}, Epilog -> Text[vars[[1]], Scaled[{.5, .9}]]]}, Table[{vars[[i]], 0, 10}, {i, 1, Length[vars]}]]; Print[args]; Apply[Manipulate, args] /. plotf -> Plot ] testFunc[{Sin[a x], b + x^2, -b x}, {x, a, b}] ******************** This code works fine with one function. My question: How can I use the same code to PLOT more than one function, say 3 functions on one PLOT? Regards, Tugrul