MATLAB: Slider Input Help!

MATLABplotslideruicontrol

Hi, I've a script which takes 2(two) input from the user and generates a plot and a value
%This is the input
currenterror = input('Enter the current error : ');
currentdelerror = input('Enter the current delerror : ');
%Program Starts
%Program Ends
a = FinalOut;
Then it produces a plot something like this
Now I want the user to have a slider input for both 'currentdelerror' & 'currenterror'
How can I do that?

Best Answer

Use uicontrol('style', 'slider') to create the two sliders, giving appropriate Position and Value and Min and Max and SliderStep parameters.
When you want to find out what the current values are, get() the Value property of the uicontrols.
You might want to add a 'Plot' pushbutton, uicontrol('Style','push'), which has as its Callback some code to get() the Value properties and to run the code with those values.