Help with slider in matlab GUI
조회 수: 3 (최근 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
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Debugging and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!