GUI - Slider which has two slide bars

조회 수: 16 (최근 30일)
James Blundell
James Blundell 2015년 4월 21일
답변: Marek Svoboda 2020년 2월 10일
Hi,
I'm creating a GUI to help me post-process some sample data collected from an eye tracker. I would like to use a slider to specify a start and end point of sample data I am interested in. To do this it would be useful to have a slider with two slide bars, one which identifies the beginning and end of the interest interval.
Is this at all possible?
James

채택된 답변

Stephen23
Stephen23 2015년 4월 21일
편집: Stephen23 2015년 4월 21일
This functionality is not supported by the inbuilt slider, but you could look at using this FEX submission:
It looks like it allows you to specify multiple sliders.
  댓글 수: 1
James Blundell
James Blundell 2015년 4월 22일
Thanks Stephen. I'll try out the FEX submission!

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Image Analyst
Image Analyst 2015년 4월 21일
You would have to use two sliders - that's what I do. Or have the user manually draw the region with rbbox().
  댓글 수: 3
Image Analyst
Image Analyst 2015년 4월 22일
Well you can either
  1. place two sliders on your existing GUI and be done with it, or
  2. you can take her FEX GUI, delete dozens of sliders that she put on there that you don't need, and then transfer all of your other controls/widgets from your GUI and transfer all the code associated with them to her GUI.
I know which approach I'd take.
Stephen23
Stephen23 2015년 4월 22일
편집: Stephen23 2015년 4월 22일
Image Analyst wrote:
Well you can either
1. place two sliders on your existing GUI and be done with it, or
2. you can take her FEX GUI, delete dozens of sliders that she put on there that you don't need, and then transfer all of your other controls/widgets from your GUI and transfer all the code associated with them to her GUI.
I know which approach I'd take.
Unfortunately this "approach" does not include actually reading the description or documentation of Danielle Ripsman's SuperSlider.
While the screenshot for the submission shows many different possibilities of what can be created using this function, these are shown merely as examples of its capabilities, as the demo code clearly clarifies. The function itself simply creates one single slider, with a selectable number of slider bars, and is called and used in much the same way as a uicontrol slider.
Nor is it required to "transfer all the code" or indeed perform any of the things that you state in your criticism. I just created a single two-bar slider with this code, from the command line:
superSlider('position',[0.1,0.1,0.8,0.1],'numslides',2)
While I have not tested it exhaustively, it seems to perform as its documentation states.
Accusations of writing useless bloatware is rather unkind, and beneath someone of your status on this forum. It misleads other browsers who might read this thread and who would then decide, based on your incorrect assumptions, that Danielle Ripsman's perfectly adequate submission is not worth considering. If someone wants two slider bars, that submission neatly achieves that goal.

댓글을 달려면 로그인하십시오.


Royi Avital
Royi Avital 2017년 9월 25일
Maybe you meant a Range Slider which you can create as shown in Sliders in Matlab GUI .

Marek Svoboda
Marek Svoboda 2020년 2월 10일
If you are trying to implement this in App Designer (which doesn't support Java), see my answer to a similar question.

카테고리

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