How do I set slider step value in Matlab?
古いコメントを表示
I am using a slider and I've set it's maximum value to +12 and minimum value to -12. I want that with every click on slider and arrow, it should increment/decrement the value of slider by 1. I've tried this code. Apparently, it should give me a total of 25 steps from +12 to -12 but it is giving me 26 steps. Also, how can I display the current value of slider using static text?
The code is given below:
function slider1_Callback(hObject, eventdata, handles)
set(handles.slider1,'min',-12);
set(handles.slider1,'max',12);
set(handles.slider1,'SliderStep',[0.04,0.04]);
end
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Entering Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!