MathGroup Archive 2007

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

Search the Archive

novice needs help using Manipulate with Plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78424] novice needs help using Manipulate with Plot
  • From: PHILLMAN5 at gmail.com
  • Date: Sun, 1 Jul 2007 07:43:46 -0400 (EDT)

Manipulate seems at first to be very powerful, but I am having trouble
using it with my own functions.  To vastly simplify my problem say I
want to plot y = m x, with x going from 0 to 10, with the slider in
Manipulate controlling m.  I have tried the following:

test := m x
Manipulate[Plot[test, {x, 0, 10}], {{m, 1}, 0, 2}]

test3[x_] := m x;
Manipulate[Plot[test3[x], {x, 0, 10}], {{m, 1}, 0, 2}]

don't seem to work.  If you define the function with m as a formal
parameter, like the following it does.

test2 = #1 #2 &;
Manipulate[Plot[test2[m , x], {x, 0, 10}], {{m, 1}, 0, 2}]

test4[m_, x_] := m x;
Manipulate[Plot[test4[m, x], {x, 0, 10}], {{m, 1}, 0, 2}]

Is there anyway to write functions to work with Manipulate without
have to have all the slider(s) formally written as a parameter to the
function?



  • Prev by Date: UI Question / Threading
  • Next by Date: Re: Maximize with Integer constraints
  • Previous by thread: Re: UI Question / Threading
  • Next by thread: Re: novice needs help using Manipulate with Plot