The code below works perfectly until I change Min from 0 to 1. Why cannot I set it 1? What is the solution?
function test3()hfig = figure();slider = uicontrol('Parent', hfig,... 'Style', 'Slider',... 'Tag', 'slider1',... 'Callback', @slider_callback,... 'Min', 0,... 'Max', 40,... 'SliderStep', [1/40 10/40]);function slider_callback(hObject, eventdata)a = get(hObject, 'Value');disp( a );
Best Answer