Create a Manipulate that plots the following expression?

GROUPS:
 xstep = (xhi - xlo)/100 x = Table [xlo + (i - 1)*xstep, {i, 1, 101}]; a0 = 9 a1 = 4 a2 = 1 a3 = 0 Ca0 = Table[5 + (i - 1), {i, 1, 101}]; Da1 = Table[a1*x]; Ea2 = Table[a2*(x^2)]; y = Da1 + Ea2 + a0; data = Transpose@{x, y}; ListPlot[{data}] I have the following code and wants to combine this with Manipulate command so that when I change the a0, a1, a2, a3, the output of graph changes. like in the following command Manipulate[ Plot[a* x^2 + b *x + c, {x, -100, 100}], {a, -1, 1, 0.2}, {b, -10, 10, 1}, {c, -50, +50, 5}] 
10 months ago
4 Replies
 Wrap all of your code in a Module[{}, your-code-goes-here-with-each-line-separated-by-a-semicolon]Put that in the Manipulate
 You may try this: xhi = 10; xlo = 0; xstep = (xhi - xlo)/100; x = Table[xlo + (i - 1)*xstep, {i, 101}]; Ca0 = Table[5 + (i - 1), {i, 101}]; Manipulate[ Da1 = a1*x; Ea2 = a2*(x^2); y = Da1 + Ea2 + a0; data = Transpose@{x, y}; ListPlot[{data}], {{a0, 9}, 0, 9, 1}, {{a1, 4}, 0, 7, 1}, {{a2, 1}, 0, 7, 1}]