MATLAB: How to set the slider step value in Matlab

sliderstep

I want my GUI slider step to start from 1 to 80. Need it to set from 1 to 80 with increment of 1 for every step. I have set the min and max in the property inspector. and the slider step to [1/79 0.1] but its increasing with decimal places.
Example of output = 0,1.04,2.08,…
I am using R2014b

Best Answer

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.