i need help for this, setting slider steps!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
조회 수: 20 (최근 30일)
이전 댓글 표시
Hello
I want to increment the value of my slider by one like [1:1:80]. For example :
1 2 3 4 5 6 7 8.......... until the value 80
how can I do this ?????
Can I do this with the Property Inspector????
댓글 수: 0
채택된 답변
Image Analyst
2015년 11월 12일
편집: Image Analyst
2015년 11월 13일
In code (your m-file) you can get the min and max and make the step one over the range:
maxSliderValue = get(handles.slider1, 'Max');
minSliderValue = get(handles.slider1, 'Min');
theRange = maxSliderValue - minSliderValue;
steps = [1/theRange, 10/theRange];
set(handles.slider1, 'SliderStep', steps);
Put this in your GUI's OpeningFcn function or whenever you change the slider's max value (which you probably don't do in your program.)
If you do it in the Property Inspector and have 1 as the min and 80 as the max, you should set the small step to 1/79 = 0.012658227848101, and the large step as some multiple of that, like 2 or 3 times as large.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!