You should review the uicontrol and uicontrol properties pages. In particular, you need to look at Value, Callback, Min, Max, and SliderStep properties. I found SliderStep the easiest to get wrong.
One bit that is not documented there is that if you drag a slider control, then you are likely to end up triggering Callback a number of times, corresponding to each fraction of a second pause in your movement. Therefor if your Callback is "expensive", you may wish to put in some kind of check to ensure the user has "stopped" before you do something graphically expensive. one of the ways to do that is to not have the callback start the action, and instead have the callback reset a timer object with a small delay. If the user keeps moving, the timer object will keep getting reset. Eventually the user will pause long enough for the timer action to kick in; have the timer callback do the "expensive" action.