Help with slider in matlab GUI

In a GUI file, how can I use a slider to increase or decrease by one unit the number contained into an edit text box ? Thanks

 採用された回答

Image Analyst
Image Analyst 2014 年 9 月 28 日

0 投票

Set up the slider like this in your start up code (untested):
sliderMin = get(handles.slider, 'Min');
sliderMax = get(handles.slider, 'Max');
increment = 1/(sliderMax-sliderMin);
sliderStep = set(handles.slider, 'Step', [increment, 2*increment]);
To get the integer value later:
sliderValue = round(get(handles.slider, 'Value'));

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEntering Commands についてさらに検索

質問済み:

2014 年 9 月 28 日

回答済み:

2014 年 9 月 28 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by