It is not clear to me, when the value "is increasing in decimal places".
uicontrol('Style', 'Slider', ...
'SliderStep', [1/79, 0.1], ...
'Min', 1, 'Max', 80, 'Value', 1, ...
'Callback', 'disp(get(gcbo, ''Value''))')
Now hitting the arrows increase the value by 1. But hitting in the area increases the value by 7.9 as expected. To get integer results, you can adjust the value in the callback:
uicontrol('Style', 'Slider', ...
'SliderStep', [1/79, 0.1], ...
'Min', 1, 'Max', 80, 'Value', 1, ...
'Callback', @sliderCallback)
function sliderCallback(hObject, EventData)
Value = round(get(hObject, 'Value'));
set(hObject, 'Value', Value);
Now the value is rounded after each interaction.
Best Answer