Help with slider in matlab GUI

2 次查看(过去 30 天)
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
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 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by