Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a function f and a slider:


How to execute/call f each time the slider is dragged?

share|improve this question
Still no code formatting or capitalization in your original question (other people were kind enough to edit)... – Ajasja Dec 12 '12 at 14:14

Like this


You can can test using for example


I advise you to look at the help of Dynamic that contains examples of other related features.

share|improve this answer

Another rout to take would be just using Manipulate. It will update content inside of it automatically in addition to automatically creating an interface.

f[y_] := y
Manipulate[f[y], {y, 1, 4}]

enter image description here

share|improve this answer
This is my code. – santhosh Dec 13 '12 at 13:15
@user4972 What do you mean? Do you need more help? – Vitaliy Kaurov Dec 13 '12 at 16:17
@VitaliyKaurov He means that he registered the code above and got a patent for it. You're forbidden to use Manipulate[] again without his granting permission. – Dr. belisarius Jan 12 '13 at 10:52
@belisarius big :D – Vitaliy Kaurov Jan 13 '13 at 6:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.